-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=monit
DEFAULT=/etc/default/$BIN
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() {
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=osirisd
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $LIB_D
- mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
+start() {
+ mkdir -p $LIB_D
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-syslog_start() {
+start() {
[ -f /etc/syslog-ng/syslog-ng.conf ] || {
echo "/etc/syslog-ng/syslog-ng.conf does not exist !";
exit 0;
[ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng
}
-syslog_stop() {
+stop() {
killall syslog-ng
}
-case "$1" in
- start)
- syslog_start
- ;;
- stop)
- syslog_stop
- ;;
- restart)
- syslog_stop
- sleep 1s
- syslog_start
- ;;
- reload)
+restart() {
+ stop
+ sleep 1
+ start
+}
+
+reload() {
kill -HUP `cat /var/run/syslog-ng.pid` &>/dev/null
- ;;
- *)
- echo "Usage: $0 <start|stop|restart|reload>"
- ;;
-esac
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-case $1 in
-start)
- /sbin/lsmod | grep ipv6 > /dev/null
- if [ "$?" != "0" ]
- then
- echo -n "IPv6 stack required by mrd6. Loading ipv6 module: "
- /sbin/insmod ipv6
- echo "Done."
- fi
- echo -n "Starting IPv6 multicast router (mrd6): "
+start() {
+ /sbin/lsmod | grep ipv6 > /dev/null
+ if [ "$?" != "0" ]; then
+ echo -n "IPv6 stack required by mrd6. Loading ipv6 module: "
+ /sbin/insmod ipv6
+ echo "Done."
+ fi
+ echo -n "Starting IPv6 multicast router (mrd6): "
/usr/sbin/mrd6 -f /etc/mrd6.conf -D
- echo "Done."
- ;;
-stop)
- echo -n "Stopping IPv6 multicast router (mrd6): "
+ echo "Done."
+}
+
+stop() {
+ echo -n "Stopping IPv6 multicast router (mrd6): "
killall mrd6
- echo "Done."
- ;;
-restart)
- $0 stop
- $0 start
- ;;
-*)
- echo "Usage: $0 {start | stop | restart}"
- ;;
-esac
-exit 0
+ echo "Done."
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/mDNSResponder
RUN_D=/var/run
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/snmpd
LIB_D=/var/lib/snmp
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $LIB_D ] || mkdir -p $LIB_D
- [ -d $LOG_D ] || mkdir -p $LOG_D
- [ -d $RUN_D ] || mkdir -p $RUN_D
- snmpd $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
+start() {
+ [ -d $LIB_D ] || mkdir -p $LIB_D
+ [ -d $LOG_D ] || mkdir -p $LOG_D
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ snmpd $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
PID_F=/var/run/peercast.pid
-case $1 in
- start)
- peercast -d -i /etc/peercast.ini -l /var/log/peercast.log -p $PID_F
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ peercast -d -i /etc/peercast.ini -l /var/log/peercast.log -p $PID_F
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=mt-daapd
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill -INT $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill -INT $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=rrdcollect
DEFAULT=/etc/default/$BIN
RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $RUN_D
- mkdir -p $IMG_D
- mkdir -p $RRD_D
- [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
- [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $RUN_D
+ mkdir -p $IMG_D
+ mkdir -p $RRD_D
+ [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
+ [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
-/usr/sbin/setserial /dev/tts/1 irq 3
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ /usr/sbin/setserial /dev/tts/1 irq 3
+}