Add OpenVPN 2.1rc12 source (unconfigured)
[tomato.git] / release / src / router / openvpn / contrib / multilevel-init.patch
blob8d48fbcdccc23e16a29f2a7e34d38f11dbc65b5b
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).
6 # Location of openvpn binary
7 -openvpn="/usr/sbin/openvpn"
8 +openvpn=/usr/sbin/openvpn
10 # Lockfile
11 -lock="/var/lock/subsys/openvpn"
12 +lock=/var/lock/subsys/openvpn
14 # PID directory
15 -piddir="/var/run/openvpn"
16 +piddir=/var/run/openvpn
18 # Our working directory
19 work=/etc/openvpn
20 @@ -106,7 +106,7 @@
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
29 @@ -116,12 +116,12 @@
30 sleep 2
33 - rm -f $piddir/*.pid $piddir/*/*.pid
34 + find $piddir -name "*.pid"|xargs rm -f
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 @@
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
53 @@ -163,7 +163,7 @@
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
62 @@ -175,7 +175,7 @@
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
71 @@ -195,7 +195,7 @@
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