-
-
Save M33FT/e05fd1406b6b5eb77d74f68e88ca0c87 to your computer and use it in GitHub Desktop.
Monitor service and restart it if down in OpenWrt.
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 | |
# Put this script run in crond. | |
service=ocserv | |
if test $(netstat -na | grep 0.0.0.0:443 | wc -l) = 2 | |
then | |
echo "$service is running!" | |
else | |
/etc/init.d/$service start | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment