diff --git a/wifi b/wifi index 3911e04..b5ec646 100755 --- a/wifi +++ b/wifi @@ -2,7 +2,7 @@ # TODO: rid ourselves of plaintext configs which can have sensitive network keys -cfg_loc="$HOME/.config/wifi-configs/" +cfg_loc="/home/shockrah/.config/wifi-configs/" iface="wlp1s0" # wpa_supplicant and dhclient are only exposed to root by default @@ -38,7 +38,9 @@ printf "network={ __kill_old() { if [ -z "$debug_kill" ] then - kill `pgrep wpa` + echo killing old process + kill "`pgrep wpa_supplicant`" + echo releasing leases dhclient -r else echo 'Not killing anything' @@ -49,10 +51,13 @@ __connect_config() { if [ -z "$debug_kill" ] then __kill_old - wpa_supplicant -B -i wlp1s0 -c /etc/wpa_supplicant.conf -D wext + echo Seriously this is going to take a minute + echo Setting up wpa_supplicant + wpa_supplicant -B -i wlp1s0 -c "$1" + echo Attempting dhclient dhclient wlp1s0 else - echo 'No restart' + echo Not connecting to anything fi } @@ -65,8 +70,7 @@ reconnect_old_config() { name="`ls $cfg_loc | dmenu -i -p 'Choose config to connect with'`" if [ ! -z "$name" ] then - __kill_old - __connect_config + __connect_config "$cfg_loc/$name" fi }