first commit
This commit is contained in:
21
proxyserver/root/check-wireguard.sh
Normal file
21
proxyserver/root/check-wireguard.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
PING=/bin/ping
|
||||
## DEBIAN
|
||||
SERVICE=/usr/sbin/service
|
||||
|
||||
tries=0
|
||||
while [[ $tries -lt 3 ]]
|
||||
do
|
||||
if $PING -c 1 10.0.10.1
|
||||
then
|
||||
echo "wg works" && curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/C6kilkNqUv?status=up&msg=OK&ping=
|
||||
exit 0
|
||||
fi
|
||||
echo "wg fail"
|
||||
tries=$((tries+1))
|
||||
done
|
||||
echo "wg failed 3 times - restarting tunnel" && curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/C6kilkNqUv?status=down&msg=OK&ping=
|
||||
|
||||
## DEBIAN
|
||||
$SERVICE wg-quick@wg1 restart && curl -fsS -m 10 --retry 5 -o /dev/null https://uptimekuma.akanealw.com/api/push/C6kilkNqUv?status=up&msg=OK&ping=
|
||||
Reference in New Issue
Block a user