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
We use essential cookies to make this site work, and optional cookies to enhance your experience.