nickolasm5
Occasional Visitor
Hello,
I am trying to set up a script that will check OpenVPN connection, if that fails - restart sevice. The service that is needed to be restarted is Amnezia Cloak.
Now I've created without issues - checking the state -
if ifconfig tun11 | grep -q "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00"
then
echo "VPN up"
else
echo "VPN down"
fi
exit 0
Yet I can't find a way how to list already running services. service --status-all just writes Done.
How can I see the list of services and their status?
What is the correct way to add the needed service to be stopped to the script above?
I am trying to set up a script that will check OpenVPN connection, if that fails - restart sevice. The service that is needed to be restarted is Amnezia Cloak.
Now I've created without issues - checking the state -
if ifconfig tun11 | grep -q "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00"
then
echo "VPN up"
else
echo "VPN down"
fi
exit 0
Yet I can't find a way how to list already running services. service --status-all just writes Done.
How can I see the list of services and their status?
What is the correct way to add the needed service to be stopped to the script above?