This commit is contained in:
2025-02-23 23:26:52 -05:00
commit aa991e46e7
5 changed files with 20 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# Script checks if openvpn connection is alive by curling from VPN server host with 3 sec timeout
#!/bin/bash
# Check if VPN connection established
curl 10.8.0.1 -m 3
# Check the exit status
if [ $? -eq 0 ]; then
echo "Connection is alive"
else
sudo systemctl restart openvpn@client
echo "VPN Connection reset$?."
fi