Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ZigFisher
Created November 9, 2018 14:14
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 ZigFisher/b0c36973c2b671f5faecb52d2dd14b29 to your computer and use it in GitHub Desktop.
Save ZigFisher/b0c36973c2b671f5faecb52d2dd14b29 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# (while sleep 5; do /usr/bin/troller >/dev/null 2>&1 ; done) &.
HOST1="192.168.213.251"
HOST2="192.168.213.252"
if ! ping -q -c 5 ${HOST1} ; then
echo "Host ${HOST1} not response, check secondary" | logger;
if ! ping -q -c 5 ${HOST2} ; then
echo "Host ${HOST2} not response, need restart vtun" | logger;
#kill -s TERM $(pidof vtund);
exit 0
else
echo "Host ${HOST2} response, tunnel alive, OK" | logger;
exit 0
fi
else
echo "Host ${HOST1} response, tunnel alive, OK" | logger;
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment