diff --git a/wirelesslogin/wireless_upkeep.sh b/wirelesslogin/wireless_upkeep.sh index 923e005..be26af3 100755 --- a/wirelesslogin/wireless_upkeep.sh +++ b/wirelesslogin/wireless_upkeep.sh @@ -32,11 +32,8 @@ function bring_it_down { } function bring_it_up { - MY_PATH="`dirname \"$0\"`" - MY_PATH="`( cd \"$MY_PATH\" && pwd )`" - passwrd_file=$MY_PATH/passwd UUID=$(nmcli -f NAME,UUID c | sift '@Wireless' | awk '{print $2}') - nmcli c up $UUID passwd-file $passwrd_file + nmcli c up $UUID passwd-file /home/tyler/shellscripts/wirelesslogin/passwd-file } function spoofy_doof { @@ -54,7 +51,6 @@ function reboot_router { } function fixit { - if [[ $(am_i_connected) != true ]]; then if [[ $(am_i_connected_to_something) == true ]]; then bring_it_down @@ -76,4 +72,9 @@ function fixit { done } -pingcheck +if [[ $(am_i_connected) == true ]]; then + pingcheck +else + bring_it_up + pingcheck +fi