
- Remplacement du test avec ps qui est trop verbeux quand le fichier de pid n'existe pas - Echapement correct des «!» darcs-hash:20080106221328-af139-42c198fcead8374604735ea60adf979b911554c1.gz
16 lines
447 B
Bash
Executable file
16 lines
447 B
Bash
Executable file
#!/bin/sh
|
|
|
|
VPN_NAME=ovh
|
|
PID_FILE=/var/run/openvpn.${VPN_NAME}.pid
|
|
|
|
if [ ! -f $PID_FILE -o ! -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
|