Skip to content

Instantly share code, notes, and snippets.

@atopuzov
Created August 28, 2016 10:42
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 atopuzov/a0cae15972e599bdc7bade4a531a524b to your computer and use it in GitHub Desktop.
Save atopuzov/a0cae15972e599bdc7bade4a531a524b to your computer and use it in GitHub Desktop.
#!/bin/sh
. /lib/functions/network.sh
network_find_wan wan_if
network_get_device wan_if_dev $wan_if
if ! ping -I $wan_if_dev -q -c 1 -W 10 8.8.8.8 > /dev/null
then
echo "Lost internet connectivity. Reconnecting." | logger -t "tester[$$]" -p info
(ifup $wan_if)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment