Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

commented Jul 10, 2015

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
You can’t perform that action at this time.