Skip to content

Instantly share code, notes, and snippets.

@hplc
Created April 1, 2020 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hplc/7a2fcc6de7f9237efe6bcb7004e74662 to your computer and use it in GitHub Desktop.
Save hplc/7a2fcc6de7f9237efe6bcb7004e74662 to your computer and use it in GitHub Desktop.
Test ocserv running status in OpenWrt, and restart it if not.
#!/bin/sh
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