]>
Commit | Line | Data |
---|---|---|
6fbf66fa JY |
1 | --- /etc/init.d/openvpn 2004-05-12 20:30:06.000000000 +0200 |
2 | +++ openvpn 2004-05-12 20:34:33.000000000 +0200 | |
3 | @@ -58,13 +58,13 @@ | |
4 | # returning success or failure status to caller (James Yonan). | |
5 | ||
6 | # Location of openvpn binary | |
7 | -openvpn="/usr/sbin/openvpn" | |
8 | +openvpn=/usr/sbin/openvpn | |
9 | ||
10 | # Lockfile | |
11 | -lock="/var/lock/subsys/openvpn" | |
12 | +lock=/var/lock/subsys/openvpn | |
13 | ||
14 | # PID directory | |
15 | -piddir="/var/run/openvpn" | |
16 | +piddir=/var/run/openvpn | |
17 | ||
18 | # Our working directory | |
19 | work=/etc/openvpn | |
20 | @@ -106,7 +106,7 @@ | |
21 | ||
22 | if [ -f $lock ]; then | |
23 | # we were not shut down correctly | |
24 | - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do | |
25 | + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do | |
26 | if [ -s $pidf ]; then | |
27 | kill `cat $pidf` >/dev/null 2>&1 | |
28 | fi | |
29 | @@ -116,12 +116,12 @@ | |
30 | sleep 2 | |
31 | fi | |
32 | ||
33 | - rm -f $piddir/*.pid $piddir/*/*.pid | |
34 | + find $piddir -name "*.pid"|xargs rm -f | |
35 | ||
36 | # Start every .conf in $work and run .sh if exists | |
37 | errors=0 | |
38 | successes=0 | |
39 | - for c in `/bin/ls *.conf */*.conf 2>/dev/null`; do | |
40 | + for c in `find * -name "*.conf" 2>/dev/null`; do | |
41 | bn=${c%%.conf} | |
42 | if [ -f "$bn.sh" ]; then | |
43 | . $bn.sh | |
44 | @@ -147,7 +147,7 @@ | |
45 | ;; | |
46 | stop) | |
47 | echo -n $"Shutting down openvpn: " | |
48 | - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do | |
49 | + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do | |
50 | if [ -s $pidf ]; then | |
51 | kill `cat $pidf` >/dev/null 2>&1 | |
52 | fi | |
53 | @@ -163,7 +163,7 @@ | |
54 | ;; | |
55 | reload) | |
56 | if [ -f $lock ]; then | |
57 | - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do | |
58 | + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do | |
59 | if [ -s $pidf ]; then | |
60 | kill -HUP `cat $pidf` >/dev/null 2>&1 | |
61 | fi | |
62 | @@ -175,7 +175,7 @@ | |
63 | ;; | |
64 | reopen) | |
65 | if [ -f $lock ]; then | |
66 | - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do | |
67 | + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do | |
68 | if [ -s $pidf ]; then | |
69 | kill -USR1 `cat $pidf` >/dev/null 2>&1 | |
70 | fi | |
71 | @@ -195,7 +195,7 @@ | |
72 | ;; | |
73 | status) | |
74 | if [ -f $lock ]; then | |
75 | - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do | |
76 | + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do | |
77 | if [ -s $pidf ]; then | |
78 | kill -USR2 `cat $pidf` >/dev/null 2>&1 | |
79 | fi |