Not sure why I can't get this while loop to work. Even when the condition(wifi network is MyWifi) the while loop continues to execute. I am a n00b. What am I doing wrong?
Code:AIRPORT="en0"; #may be en0, use networksetup -listallhardwareports to check WIFI= /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'; echo $WIFI while [ '$WIFI' != "MyWifi" ]; do echo $WIFI networksetup -setairportpower $AIRPORT off networksetup -setairportpower $AIRPORT on WIFI= networksetup -getairportnetwork en0 sleep 10 echo $WIFI done

Reply With Quote

