How can I start or stop openvpn server #1 on my AC68U (latest Merlin) by command line?
I would like to start and stop openvpn using cru... thanks!
service stop_vpnserver1
service start_vpnserver1
This works like a charm, but is there a status version of that command?
I was trying
Code:service status_vpnclient1
But it just outputs done, like when I start it or stop it.
VPNID=3;VPNSTATE=$(nvram get vpn_client${VPNID}_state); case $VPNSTATE in 2) echo "Client $VPNID UP";;0) echo "Client $VPNID DOWN";;1) echo "Client $VPNID Connecting";;*) echo "Client $VPNID in ERROR";;esac
Unfortunately the 'service' command will always output 'done' even if the command request is invalid.
However, despite the OP title referring to the VPN Server, if you want to check the status of a VPN Client, you can use a one-line command/script
e.g. Check VPN Client 3
Code:VPNID=3;VPNSTATE=$(nvram get vpn_client${VPNID}_state); case $VPNSTATE in 2) echo "Client $VPNID UP";;0) echo "Client $VPNID DOWN";;1) echo "Client $VPNID Connecting";;esac
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!