Created
December 21, 2016 15:50
-
-
Save aukjan/14aa3ebf8bb6824d6515f0e67c71b2ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| [[ -d ${HOME}/log ]] || mkdir -p ${HOME}/log | |
| echo "$(date) [START] Starting WIFI Watch" >> ${HOME}/log/wifi_reset.log | |
| while [ 1 ] | |
| do | |
| ping -c 5 -t 10 8.8.8.8 || ( | |
| echo "$(date) [RESET] Resetting WIFI connection " >> ${HOME}/log/wifi_reset.log | |
| networksetup -setairportpower en0 off | |
| sleep 5 | |
| networksetup -setairportpower en0 on | |
| sleep 30 | |
| ); | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment