repo.or.cz
/
vpnc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Alexey Sopov <suntechnic@gmail.com>
[vpnc.git]
/
vpnc-disconnect
blob
6806b93e20d4fc8e2d06ce0206b43fc9385e112e
1
#!/bin/sh
2
3
pid
=/
var
/
run
/
vpnc
/
pid
4
5
if
[
$#
-ne
0
];
then
6
echo
"Usage:
$0
"
1
>&
2
7
exit
1
8
fi
9
10
PID
=
"$(cat "
$pid
" 2> /dev/null)"
11
12
if
[
-z
"
$PID
"
];
then
13
echo
"no vpnc found running"
14
exit
1
15
fi
16
17
if
!
kill -0
"
$PID
"
> /
dev
/
null
2
>&
1
;
then
18
echo
"no vpnc found running"
19
exit
1
20
fi
21
22
echo
"Terminating vpnc daemon (pid:
$PID
)"
23
exec kill
$PID