Skip to content

Instantly share code, notes, and snippets.

@kasperhartwich
Created November 13, 2013 12:42
Show Gist options
  • Select an option

  • Save kasperhartwich/7448463 to your computer and use it in GitHub Desktop.

Select an option

Save kasperhartwich/7448463 to your computer and use it in GitHub Desktop.
#!/bin/bash
x=`ping -c1 google.com 2>&1 | grep unknown`
if [ ! "$x" = "" ]; then
echo "$(date +'%F %T') Restarting network" >/var/log/network_monitor.log
service network restart
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment