added scripts from local machines

This commit is contained in:
2023-08-11 13:11:42 -05:00
parent fa765dc012
commit 9eeee520ed
10 changed files with 64 additions and 0 deletions

View 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 http://192.168.1.4:8000/ping/12b1795f-a72a-479b-845b-f2576e8a546d
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 http://192.168.1.4:8000/ping/12b1795f-a72a-479b-845b-f2576e8a546d/fail
## DEBIAN
$SERVICE wg-quick@wg1 restart