A very simple script to manage WiFi connections
awk
dhcpcd
iproute2
iw
# ./wifimgr.sh scan
example output:
Signal SSID Enc Freq Ch WPS
------------------------------------------------------------------------------
-65.00 safenet2.4 WPA2 2457 10 Yes
-76.00 safenet5 WPA2 5500 100
-81.00 opennet Open 2462 11
# ./wifimgr.sh connect PROTOCOL SSID [PASSWORD]
connects to a network with the specified SSID
and PASSWORD
.
PROTOCOL
is either:
plain
for open networks (withoutPASSWORD
)wep
for WEP networkswpa
for WPA networks
# ./wifimgr.sh save PROFILE
saves the current connection obtained with connect
and stores it with the name PROFILE
(connect
must be run first to be able to save
a connection)
# ./wifimgr.sh start PROFILE
connects to a previously saved connection with the name PROFILE
(save
must be run first to be able to start
a saved connection)
# ./wifimgr.sh stop
stops a connection (releases DHCP lease and kills wpa_supplicant
)
# ./wifimgr.sh status
shows some information about the current connected access point
# ./wifimgr.sh help
- the directory where the profiles are saved can be modified by changing the variable
$SAVEDIR
inwifimgr.sh
(default/etc/wifimgr/
) wifimgr
stores the WiFi SSIDs and passwords as plaintext files in the hard drivewifimgr
was written to handle systems with a single WiFi interface (by default it uses the first one reported byiw
)