Skip to content

Instantly share code, notes, and snippets.

@carlossg
Created July 10, 2015 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlossg/8fdd3d3d74cfc5d355e3 to your computer and use it in GitHub Desktop.
Save carlossg/8fdd3d3d74cfc5d355e3 to your computer and use it in GitHub Desktop.
DHCP monitor and reload
#!/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
echo "add State:/Network/Interface/en0/RefreshConfiguration temporary" | scutil
@carlossg
Copy link
Author

reload dhcp when there are connection issues in order to workaround tunnelblick vpn issues
https://groups.google.com/forum/#!topic/tunnelblick-discuss/xz6Z5to8pKM

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