Skip to content
Snippets Groups Projects
Commit 92325d27 authored by Bruno BEAUFILS's avatar Bruno BEAUFILS
Browse files

vpn: ajout restart à vpnlille1

parent 804605e6
Branches master
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
# COMMANDE
# start démarre une connection au VPN personnels de Lille 1
# stop stoppe la connection au VPN personnels de Lille 1
# restart stop puis start
# conf génère un fichier LILLE1.ovpn
# -h, --help, help affiche ce message d'aide
......@@ -131,18 +132,34 @@ EOF
# doc is included as comments from 2nd line of the script to first empty line
doc () { sed -n '2,/^$/ { s/^ *#// ; s/^ //g ; t e ; d ; :e p }' <$0 ; }
# Le travail effectif
case "$1" in
"start")
# démarrer le vpn
start_vpn ()
{
verifie sudo
verifie openvpn
sudo openvpn --daemon \
--config ${vpnconf}
;;
"stop")
}
# arrêter le vpn
stop_vpn ()
{
verifie pgrep
pid=$(pgrep openvpn)
test -z "$pid" || sudo kill $pid
}
# Le travail effectif
case "$1" in
"start")
start_vpn
;;
"stop")
stop_vpn
;;
"restart")
stop_vpn
start_vpn
;;
"conf")
cp ${vpnconf} .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment