14 lines
419 B
Bash
Executable File
14 lines
419 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
|
|
if ! ps ax | grep openvpn | grep -v grep > /dev/null ; then
|
|
echo -e "\n\tOpenVPN is not running. so i'm going to (re)start the vpn service..\n"
|
|
/etc/init.d/openvpn stop
|
|
kill -9 `cat /var/run/openvpn.server.pid 2>/dev/null` > /dev/null 2>&1
|
|
rm -f /var/run/openvpn.server.pid
|
|
/etc/init.d/openvpn start
|
|
fi
|
|
|
|
exit 0;
|