#!/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