Created
June 13, 2017 12:13
-
-
Save hplc/53b5da26b2d804af3e6ac2cb3bdd5d44 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
@yoursunny