scripts/secours/check-vpn-from-crans
Jeremie Dimino 37bac59749 [[ ]] c'est mieux que [ ]
darcs-hash:20080106222221-af139-f6372d6eda53c94395fb788058ad73f6798a7f91.gz
2008-01-06 23:22:21 +01:00

16 lines
451 B
Bash
Executable file

#!/bin/bash
VPN_NAME=ovh
PID_FILE=/var/run/openvpn.${VPN_NAME}.pid
if [[ ! -f $PID_FILE || ! -d /proc/$(< $PID_FILE) ]] && ! fping -q ovh.adm.crans.org; then
if fping -q ovh.crans.org; then
if /etc/init.d/openvpn start ${VPN_NAME} > /dev/null; then
echo 'Lancement du tunnel vers OVH reussi !'
exit 0
else
echo 'Echec du lancement du tunnel vers OVH !'
exit 1
fi
fi
fi