Created
June 23, 2015 06:27
-
-
Save idefux/eacb3783487cfb2b6289 to your computer and use it in GitHub Desktop.
dd-wrt check if OpenVPN server is alive
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 | |
# This script checks if OpenVPN Server is alive. | |
# If not openpvn server will be started. | |
# Put this script in jffs/scripts/check_ovpn.sh. | |
# Call it via cron job (GUI -> Administration -> Management): */1 * * * * root /jffs/scripts/check_ovpn.sh | |
# This will trigger the script in 1 minute intervall. | |
OPENVPN_ALIVE=`ps | grep -v grep | grep -c "openvpn --daemon"` | |
if [ "$OPENVPN_ALIVE" -eq 0 ]; then | |
#echo "openvpn is down" | |
`openvpn --daemon --config /tmp/openvpn/openvpn.conf` | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment