Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hacks-lille1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
b3
hacks-lille1
Commits
92325d27
Commit
92325d27
authored
7 years ago
by
Bruno BEAUFILS
Browse files
Options
Downloads
Patches
Plain Diff
vpn: ajout restart à vpnlille1
parent
804605e6
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
vpn/vpnlille1
+24
-7
24 additions, 7 deletions
vpn/vpnlille1
with
24 additions
and
7 deletions
vpn/vpnlille1
+
24
−
7
View file @
92325d27
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
# COMMANDE
# COMMANDE
# start démarre une connection au VPN personnels de Lille 1
# start démarre une connection au VPN personnels de Lille 1
# stop stoppe la 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
# conf génère un fichier LILLE1.ovpn
# -h, --help, help affiche ce message d'aide
# -h, --help, help affiche ce message d'aide
...
@@ -131,18 +132,34 @@ EOF
...
@@ -131,18 +132,34 @@ EOF
# doc is included as comments from 2nd line of the script to first empty line
# 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
;
}
doc
()
{
sed
-n
'2,/^$/ { s/^ *#// ; s/^ //g ; t e ; d ; :e p }'
<
$0
;
}
#
Le travail effectif
#
démarrer le vpn
case
"
$1
"
in
start_vpn
()
"start"
)
{
verifie
sudo
verifie
sudo
verifie openvpn
verifie openvpn
sudo
openvpn
--daemon
\
sudo
openvpn
--daemon
\
--config
${
vpnconf
}
--config
${
vpnconf
}
;;
}
"stop"
)
# arrêter le vpn
stop_vpn
()
{
verifie pgrep
verifie pgrep
pid
=
$(
pgrep openvpn
)
pid
=
$(
pgrep openvpn
)
test
-z
"
$pid
"
||
sudo kill
$pid
test
-z
"
$pid
"
||
sudo kill
$pid
}
# Le travail effectif
case
"
$1
"
in
"start"
)
start_vpn
;;
"stop"
)
stop_vpn
;;
"restart"
)
stop_vpn
start_vpn
;;
;;
"conf"
)
"conf"
)
cp
${
vpnconf
}
.
cp
${
vpnconf
}
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment