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