Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Last active August 29, 2015 14:03
Show Gist options
  • Save Sigmus/b6ad013b123bcaf9442d to your computer and use it in GitHub Desktop.
Save Sigmus/b6ad013b123bcaf9442d to your computer and use it in GitHub Desktop.
#!/bin/bash
while [ 1 ]
do
if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ]
then $(networksetup -setairportnetwork en1 DigitalBox q2w3e4r5)
fi
sleep 3
done
@liperuf
Copy link

liperuf commented Jul 1, 2014

com frufru:

#!/bin/bash
while [ 1 ]
do
    if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ]
        then $(networksetup -setairportnetwork en1 DigitalBox q2w3e4r5 && say reconnecting && osascript -e 'display notification "Reconectando..." with title "WiFi"')
    fi
    sleep 3
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment