- add runlevel script
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 16 Feb 2007 18:11:48 +0000 (18:11 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 16 Feb 2007 18:11:48 +0000 (18:11 -0000)
package/l2tp/l2tp.mk
package/l2tp/l2tpd [new file with mode: 0755]

index 6f623362bcf7c2b8530dc4b0785d14131f8a0755..1efc631ccf63ced38a5a4dab3f861454690493c7 100644 (file)
@@ -39,6 +39,7 @@ $(L2TP_DIR)/$(L2TP_BINARY): $(L2TP_DIR)/.unpacked
 
 $(TARGET_DIR)/$(L2TP_TARGET_BINARY): $(L2TP_DIR)/$(L2TP_BINARY)
        cp -dpf $(L2TP_DIR)/$(L2TP_BINARY) $@
+       cp -dpf package/l2tp/l2tpd $(TARGET_DIR)/etc/init.d/
        $(STRIP) $@
 
 l2tp: uclibc $(TARGET_DIR)/$(L2TP_TARGET_BINARY)
diff --git a/package/l2tp/l2tpd b/package/l2tp/l2tpd
new file mode 100755 (executable)
index 0000000..0b51339
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/sbin/l2tpd
+PIDFILE=/var/run/l2tpd.pid
+
+test -f $DAEMON || exit 0
+
+case "$1" in
+  start)
+    start-stop-daemon --start  --pidfile $PIDFILE --exec $DAEMON -- -D &
+    ;;
+  stop)
+    start-stop-daemon --stop  --pidfile $PIDFILE --exec $DAEMON
+    ;;
+  restart|force-reload)
+    start-stop-daemon --stop  --pidfile $PIDFILE --exec $DAEMON 
+    sleep 1
+    start-stop-daemon --start  --pidfile $PIDFILE --exec $DAEMON
+    ;;
+  *)
+    echo "Usage: /etc/init.d/l2tdp {start|stop|restart|force-reload}"
+    exit 1
+    ;;
+esac
+
+exit 0