Created
July 10, 2015 12:22
-
-
Save carlossg/8fdd3d3d74cfc5d355e3 to your computer and use it in GitHub Desktop.
DHCP monitor and reload
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/sh | |
HOSTS="8.8.8.8" | |
COUNT=1 | |
while true | |
do | |
for myHost in $HOSTS; do | |
if ! ping -c $COUNT $myHost > /dev/null; then | |
echo "Host : $myHost is down (ping failed) at $(date)" | |
dhcp-reload | |
fi | |
done | |
sleep 5 | |
done |
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
echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | scutil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reload dhcp when there are connection issues in order to workaround tunnelblick vpn issues
https://groups.google.com/forum/#!topic/tunnelblick-discuss/xz6Z5to8pKM