port lots of init scripts over to rc.common (more to come)
[packages.git] / net / l2tpd / files / l2tpd.init
index f531757..eeecae5 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
 
 BIN=l2tpd
 DEFAULT=/etc/default/$BIN
@@ -6,16 +7,11 @@ RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
 [ -f $DEFAULT ] && . $DEFAULT
 
-case $1 in
- start)
-  $BIN $OPTIONS
-  ;;
- stop)
-  [ -f $PID_F ] && kill $(cat $PID_F)
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
+start() {
+       $BIN $OPTIONS
+}
+
+stop() {
+       [ -f $PID_F ] && kill $(cat $PID_F)
+}
 
-exit $?