Created
November 9, 2018 14:14
-
-
Save ZigFisher/b0c36973c2b671f5faecb52d2dd14b29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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