Created
September 26, 2015 16:19
-
-
Save Algogator/b5fb45a083d5f0bcf42c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#http://askubuntu.com/questions/16143/is-there-a-way-to-start-a-bash-script-after-boot-only-when-wlan0-is-connected | |
while true | |
do | |
nmcli -t -f DEVICE,STATE dev | grep -q "^wlan0:connected$" | |
if [ $? -eq 0 ]; then | |
break | |
else | |
sleep 60 | |
fi | |
done | |
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' | mail -s "IP Address" "philipskd@gmail.com,philipskd@yahoo.com,anna.cs.au@gmail.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment