#!/bin/bash # script to turn on openvpn # do nothing if it is not installed which openvpn if [ $? -ne 0 ]; then echo Cannot find the OpenVPN program (openvpn). exit 1 fi systemctl disable openvpn@xscenet.service systemctl stop openvpn@xscenet.service sleep 5 ps -e|grep vpn if [ $? -eq 0 ]; then echo OpenVPN failed to stop. else echo Successfully stopped and disabled OpenVPN. fi