port over more init scripts

git-svn-id: svn://svn.openwrt.org/openwrt/packages@4918 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2006-10-04 21:04:48 +00:00
parent 2295d502f6
commit 8b12dd0b90
10 changed files with 106 additions and 144 deletions

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=monit
DEFAULT=/etc/default/$BIN
@ -6,20 +7,12 @@ 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() {
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=osirisd
DEFAULT=/etc/default/$BIN
@ -7,17 +8,12 @@ RUN_D=/var/run
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)
}

View File

@ -1,6 +1,7 @@
#!/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;
@ -9,26 +10,17 @@ syslog_start() {
[ -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
}

View File

@ -1,29 +1,21 @@
#!/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."
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/mDNSResponder
RUN_D=/var/run

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/snmpd
LIB_D=/var/lib/snmp
@ -8,18 +9,14 @@ PID_F=$RUN_D/snmpd.pid
[ -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)
}

View File

@ -1,18 +1,13 @@
#!/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
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=mt-daapd
DEFAULT=/etc/default/$BIN
@ -6,17 +7,12 @@ 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
;;
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 $?

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=rrdcollect
DEFAULT=/etc/default/$BIN
@ -11,21 +12,16 @@ RRD_D=$LIB_D/rrd
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 $?

View File

@ -1,2 +1,6 @@
#!/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
}