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 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
I know it's a stupid question, but. . .
I am using the luci-app-https service, which is a type of "DNS Over HTTPS", and sometimes this service crashes due to a problem with my internet and I have to restart it again, because if I do not do this, no "Website" will not open.
I did not work with the script file in Openwrt and I do not know the script commands.
Can you tell me exactly where I should put this script?
Do you mean Crontab?
And do I have to do the following to restart the luci-app-https service after a 50 second pause?
Thanks bro
@hplc