Skip to content

Shell-script program to add the new Wi-Fi to wpa_supplicant.conf

License

Notifications You must be signed in to change notification settings

kkatsuyuki/wifi-entries-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wifi-entries-setup

wifi-entries-setup is the shell-script program which adds the new Wi-Fi entry to assigned configuration file (ex. wpa_supplicant.conf) using wpa_passphrase.

Requirements

It requires the following Wi-Fi confuguration program.

Install

Download and modify the path of the configuration file (default: /etc/wpa_supplicant/wpa_supplicant.conf) in wifi-entries-setup.

$ git clone https://github.com/kkatsuyuki/wifi-entries-setup.git
$ cd wifi-entries-setup

Edit wifi-entries-setup to adjust CONFIG_FILE to your environment.

CONFIG_FILE=/to/yourpath/wpa_supplicant.conf

Edit wifi-entries-setup to select an INTERFACE for your system

INTERFACE="wlp2s0"

Then move this executable wifi-entries-setup file to the directory included in $PATH (usually /usr/bin/).

$ cp wifi-entries-setup /usr/bin/

Usage

Usage: wifi-entries-setup [-h]

Get the root privilege and execute wifi-entries-setup. Input SSID and Passphrase (optional) interactively following the prompt.

  • Passphrase is not given, then the entry is registered as the open network.
  • If the command executed with -h option, the help message is appeared.

Example

Add the wireless network whose SSID and passphrase are “foo” and “foobarbaz”, respectively.

# wifi-entries-setup
Starting to scan WiFi ...
0: foo
1: bar
2: baz

Which SSID is registered? (input by No.) > 0
Input passphrase (default NONE) > foobarbaz
Protected Wifi network
SSID foo was registered and you can connect.

How to connect the Wi-Fi after registered

The followings are refered to Wireless network configuration on ArchWiki.

If necessary, make the Wi-Fi interface enabled at first.

# ip link set <interface> up

Then get the authentification and IP address from the wireless network.

# wpa_supplicant -B -i <interface> -c /to/yourpath/wpa_supplicant.conf
# dhcpcd -b <interface>

References

I refered to the following to make this source code.

About

Shell-script program to add the new Wi-Fi to wpa_supplicant.conf

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages