aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch
blob: 14a768d0feb2935344c66f6b251b4e00111fef70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Fix start error if lsb init-functions doesn't exist

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>

diff --git a/debian/init.d b/debian/init.d
index 363ba89..0327fec 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -10,6 +10,9 @@
 # Description:       Start ippool daemon
 ### END INIT INFO
 
+# Source function library.
+. /etc/init.d/functions
+
 DAEMON=/usr/sbin/ippoold
 NAME=ippoold
 MODULE=pppol2tp
@@ -18,7 +21,23 @@ MODULE=pppol2tp
 test -x $DAEMON || exit 0
 
 # Get lsb functions
-. /lib/lsb/init-functions
+if [ -f /lib/lsb/init-functions ]
+then
+  . /lib/lsb/init-functions
+else
+  log_begin_msg() {
+    echo -n $*
+  }
+
+  log_end_msg() {
+    if [ $1 -eq 0 ]; then
+      echo "done"
+    else
+      echo "failed"
+    fi
+  }
+fi
+
 . /etc/default/rcS
 
 case "$1" in
@@ -35,6 +54,10 @@ case "$1" in
     fi
     log_end_msg $?
     ;;
+  status)
+    status /usr/sbin/ippoold;
+    exit $?
+    ;;
   restart)
     $0 stop
     sleep 1
@@ -46,7 +69,7 @@ case "$1" in
     log_end_msg $?
     ;;
   *)
-    log_success_msg "Usage: /etc/init.d/ippoold {start|stop|restart|reload|force-reload}"
+    log_success_msg "Usage: /etc/init.d/ippoold {start|stop|status|restart|reload|force-reload}"
     exit 1
 esac