fix ettercap compile
[openwrt/svn-archive/archive.git] / admin / monit / files / monit.init
index 50b18de149597aa65ca97ad6e74113c05fa9e995..6a3e5c081399487db97294d1c09c6bd191e2d79c 100644 (file)
@@ -1,25 +1,19 @@
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
 
+START=60
 BIN=monit
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
-case $1 in
- start)
-  mkdir -p $RUN_D
-  $BIN $OPTIONS
-  ;;
- stop)
-  [ -f $PID_F ] && kill $(cat $PID_F)
-  ;;
- restart)
-  $0 stop
-  $0 start
-  ;;
- *)
-  echo "usage: $0 (start|stop|restart)"
-  exit 1
-esac
-exit $?
+start() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       mkdir -p $RUN_D
+       $BIN $OPTIONS
+}
+
+stop() {
+       [ -f $PID_F ] && kill $(cat $PID_F)
+}
+