-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=avahi-daemon
DEFAULT=/etc/default/$BIN
RUN_D=/var/run/$BIN
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
+start() {
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
$BIN -k
- ;;
- reload)
+}
+
+reload() {
$BIN -r
- ;;
- *)
- echo "usage: $0 (start|stop|reload)"
- exit 1
-esac
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/autopid
RUN_D=/var/run
PID_F=$RUN_D/autoipd.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- autoipd $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ autoipd $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
PID_F=$RUN_D/mDNSResponder.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- mDNSResponder $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ mDNSResponder $OPTIONS
+}
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/nifd
RUN_D=/var/run
PID_F=$RUN_D/nifd.pid
-
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- nifd $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ nifd $OPTIONS
+}
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-case "$1" in
- start)
+start() {
aiccu start
- ;;
+}
- stop)
+stop() {
aiccu stop
- aiccu stop
- ;;
-
- restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
- ;;
-esac
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-if [ -f /etc/bind/named.conf ]; then
- named -c /etc/bind/named.conf
-fi
+start() {
+ if [ -f /etc/bind/named.conf ]; then
+ named -c /etc/bind/named.conf
+ fi
+}
+
+stop() {
+ killall named
+}
-#!/bin/sh
-# make /tmp/.bitchxrc as many servers ban root
-if [ ! -e /tmp/.bitchxrc ]
-then
- echo "IRCUSER OpenWrt" >/tmp/.bitchxrc
- echo "IRCNAME OpenWrt User!" >>/tmp/.bitchxrc
-fi
+#!/bin/sh /etc/rc.common
+
+start() {
+ # make /tmp/.bitchxrc as many servers ban root
+ if [ ! -e /tmp/.bitchxrc ]
+ then
+ echo "IRCUSER OpenWrt" >/tmp/.bitchxrc
+ echo "IRCNAME OpenWrt User!" >>/tmp/.bitchxrc
+ fi
+}
-#!/bin/sh
-mkdir -p /var/lib/bitlbee
-bitlbee -D
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ mkdir -p /var/lib/bitlbee
+ bitlbee -D
+}
+
+stop() {
+ killall bitlbee
+}
-#!/bin/sh
-. /etc/functions.sh
-include /lib/network
-scan_interfaces
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
RUN_D=/var/run
PID_F=$RUN_D/chilli.pid
-case $1 in
- start)
- /sbin/insmod tun >/dev/null 2>&1
- [ -d $RUN_D ] || mkdir -p $RUN_D
- config_get ipaddr lan ipaddr
- /usr/sbin/chilli --dns1="$ipaddr"
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ include /lib/network
+ scan_interfaces
+ /sbin/insmod tun >/dev/null 2>&1
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ config_get ipaddr lan ipaddr
+ /usr/sbin/chilli --dns1="$ipaddr"
+}
-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
-killall -q click
-cp /usr/bin/srcr.click /tmp
-sh /usr/bin/gen_config_roofnet.sh > /tmp/unaligned.click
-click-align /tmp/unaligned.click > /tmp/roofnet.click
-/usr/bin/click /tmp/roofnet.click > /tmp/roofnet.log 2>&1 &
+start() {
+ killall -q click
+ cp /usr/bin/srcr.click /tmp
+ sh /usr/bin/gen_config_roofnet.sh > /tmp/unaligned.click
+ click-align /tmp/unaligned.click > /tmp/roofnet.click
+ /usr/bin/click /tmp/roofnet.click > /tmp/roofnet.log 2>&1 &
+}
+
+stop() {
+ killall click
+}
-#!/bin/sh
-mkdir -p /tmp/cups
-mkdir -p /tmp/spool/cups/tmp
-exec /usr/sbin/cupsd
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ mkdir -p /tmp/cups
+ mkdir -p /tmp/spool/cups/tmp
+ /usr/sbin/cupsd
+}
+
+stop() {
+ killall cupsd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
LOG_D=/var/log
RUN_D=/var/run
PID_F=$RUN_D/dhcpd-fwd.pid
-case $1 in
- start)
- [ -d $LOG_D ] || mkdir -p $LOG_D
- [ -d $RUN_D ] || mkdir -p $RUN_D
- dhcp-fwd
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ [ -d $LOG_D ] || mkdir -p $LOG_D
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ dhcp-fwd
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=ez-ipupdate
CONF=/etc/$BIN.conf
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
-[ -f $CONF ] || exit
-case $1 in
- start)
- mkdir -p $RUN_D
- $BIN -c $CONF
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ [ -f $CONF ] || exit
+ mkdir -p $RUN_D
+ $BIN -c $CONF
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/radiusd
LOG_D=/var/log/radius
PID_F=$RUN_D/radiusd.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $LOG_D ] || mkdir -p $LOG_D
- [ -d $RUN_D ] || mkdir -p $RUN_D
- radiusd $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ [ -d $LOG_D ] || mkdir -p $LOG_D
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ radiusd $OPTIONS
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=frickin
DEFAULT=/etc/default/$BIN
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- $BIN $OPTIONS &
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS &
+}
+
+stop() {
+ killall $BIN
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=gmediaserver
DEFAULT=/etc/default/$BIN
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 $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=htpdate
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $RUN_D
- $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $RUN_D
+ $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=l2tpd
DEFAULT=/etc/default/$BIN
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 $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=lighttpd
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $LOG_D
- mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $LOG_D
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
-[ -d /etc/maradns ] || mkdir -p /etc/maradns
-[ -d /etc/maradns/logger ] || mkdir -p /etc/maradns/logger
-duende /usr/sbin/maradns
-duende /usr/sbin/zoneserver
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ [ -d /etc/maradns ] || mkdir -p /etc/maradns
+ [ -d /etc/maradns/logger ] || mkdir -p /etc/maradns/logger
+ duende /usr/sbin/maradns
+ duende /usr/sbin/zoneserver
+}
+
+stop() {
+ killall duende maradns zoneserver
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT="/etc/default/miau"
OPTIONS="-d /etc/miau/"
ERR_LOG="$LOG_DIR/error.log"
OUT_LOG="$LOG_DIR/miau.log"
-[ -f $DEFAULT ] && . $DEFAULT
-[ "$ENABLE_MIAU" = "yes" ] || exit 0
+start() {
+ [ -f $DEFAULT ] && . $DEFAULT
+ [ "$ENABLE_MIAU" = "yes" ] || exit 0
+ [ -f /var/run/miau.pid ] && {
+ echo "[ERROR] miau is running"
+ exit 0
+ }
+ [ -d $LOG_DIR ] || mkdir -p $LOG_DIR
+ /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
+ PID=$!
+ sleep 1
+ if [ -d /proc/$PID ]; then
+ echo $PID > /var/run/miau.pid
+ else
+ echo "[ERROR] Unable to run miau as a daemon"
+ fi
+}
-case $1 in
- start)
- [ -f /var/run/miau.pid ] && echo "[ERROR] miau is running"
- [ -f /var/run/miau.pid ] && exit 0
- [ -d /var/run ] || mkdir -p /var/run
- [ -d $LOG_DIR ] || mkdir -p $LOG_DIR
- /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
- PID=$!
- sleep 1
- [ -d /proc/$PID ] && echo $PID > /var/run/miau.pid
- [ -d /proc/$PID ] || echo "[ERROR] Unable to run miau as a daemon"
- ;;
- stop)
- [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-
-exit $?
+stop() {
+ [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=mini_httpd
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 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)
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=miredo-server
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- insmod ipv6
- insmod tun
- $BIN $OPTIONS
- ;;
- 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
+ insmod ipv6
+ insmod tun
+ $BIN $OPTIONS
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=miredo
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- insmod ipv6
- insmod tun
- $BIN $OPTIONS
- ;;
- 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
+ insmod ipv6
+ insmod tun
+ $BIN $OPTIONS
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-#!/bin/sh
-test -n "$FAILSAFE" && exit
-/usr/bin/netserver
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ /usr/bin/netserver
+}
+
+stop() {
+ killall netserver
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
NFS_D=/var/lib/nfs
-_start() {
- mkdir -p $NFS_D
- touch $NFS_D/rmtab
-
- /usr/sbin/rpc.statd
- /usr/sbin/rpc.lockd
- /usr/sbin/exportfs -r
- /usr/sbin/rpc.nfsd
- /usr/sbin/rpc.mountd
+start() {
+ mkdir -p $NFS_D
+ touch $NFS_D/rmtab
+
+ /usr/sbin/rpc.statd
+ /usr/sbin/rpc.lockd
+ /usr/sbin/exportfs -r
+ /usr/sbin/rpc.nfsd
+ /usr/sbin/rpc.mountd
}
-_stop() {
- killall rpc.mountd 2> /dev/null
- killall -9 nfsd 2> /dev/null
- /usr/sbin/exportfs -au
- killall lockd 2> /dev/null
- killall rpc.statd 2> /dev/null
+stop() {
+ killall rpc.mountd 2> /dev/null
+ killall -9 nfsd 2> /dev/null
+ /usr/sbin/exportfs -au
+ killall lockd 2> /dev/null
+ killall rpc.statd 2> /dev/null
}
-_reload() {
- /usr/sbin/exportfs -r
+reload() {
+ /usr/sbin/exportfs -r
}
-case $1 in
- start)
- _start
- ;;
- stop)
- _stop
- ;;
- reload)
- _reload
- ;;
- restart)
- _stop
- sleep 1
- _start
- ;;
- *)
- echo "usage: $0 (start|stop|reload|restart)"
- exit 1
-esac
-exit $?
-#!/bin/sh
-/usr/sbin/portmap
-/usr/sbin/rpc.mountd -r
-/usr/sbin/rpc.nfsd
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ /usr/sbin/portmap
+ /usr/sbin/rpc.mountd -r
+ /usr/sbin/rpc.nfsd
+}
+
+stop() {
+ killall rpc.nfsd
+ killall rpc.mountd
+ killall portmap
+}
#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+
ntp_server=$(nvram get ntp_server)
case "${ACTION:-ifup}" in
ifup)
-#!/bin/sh
-/usr/sbin/oidentd -m -f 113
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+start() {
+ /usr/sbin/oidentd -m -f 113
+}
+
+stop() {
+ killall oidentd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/olsrd
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- olsrd $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ olsrd $OPTIONS
+}
-exit $?
+stop() {
+ killall olsrd
+}
-#!/bin/sh
-mkdir -p `awk -F: '/^ntp:/{print $6}' /etc/passwd`
-/usr/sbin/ntpd -s
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ mkdir -p `awk -F: '/^ntp:/{print $6}' /etc/passwd`
+ /usr/sbin/ntpd -s
+}
+
+stop() {
+ killall ntpd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-for type in rsa dsa; do {
- # check for keys
- key=/etc/ssh/ssh_host_${type}_key
- [ ! -f $key ] && {
- # generate missing keys
- [ -x /usr/bin/ssh-keygen ] && {
- /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
- } &
- exit 0
- }
-}; done
-mkdir -p /var/empty
-/usr/sbin/sshd
+start() {
+ for type in rsa dsa; do {
+ # check for keys
+ key=/etc/ssh/ssh_host_${type}_key
+ [ ! -f $key ] && {
+ # generate missing keys
+ [ -x /usr/bin/ssh-keygen ] && {
+ /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
+ } &
+ exit 0
+ }
+ }; done
+ mkdir -p /var/empty
+ /usr/sbin/sshd
+}
+
+stop() {
+ killall sshd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/p910nd
RUN_D=/var/run
-_start() {
- mkdir -p $RUN_D
- [ -f $DEFAULT ] && (
- while read port options; do
- case "$port" in
- ""|\#*)
- continue;
- esac
- p910nd $options $port
- if [ $? -ne 0 ]; then
- exit 1
- fi
- done
- ) < $DEFAULT
- exit 0
+start() {
+ mkdir -p $RUN_D
+ [ -f $DEFAULT ] && (
+ while read port options; do
+ case "$port" in
+ ""|\#*) continue;;
+ esac
+ p910nd $options $port
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ done
+ ) < $DEFAULT
}
-_stop() {
- [ -f $DEFAULT ] && (
- while read port options; do
- case "$port" in
- ""|\#*)
- continue;
- esac
- PID_F=$RUN_D/p910${port}d.pid
- [ -f $PID_F ] && kill $(cat $PID_F)
- done
- ) < $DEFAULT
+stop() {
+ [ -f $DEFAULT ] && (
+ while read port options; do
+ case "$port" in
+ ""|\#*) continue;l
+ esac
+ PID_F=$RUN_D/p910${port}d.pid
+ [ -f $PID_F ] && kill $(cat $PID_F)
+ done
+ ) < $DEFAULT
}
-case $1 in
- start)
- _start
- ;;
- stop)
- _stop
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=parprouted
DEFAULT=/etc/default/$BIN
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS
+}
-exit $?
+stop() {
+ killall $BIN
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=pgtext
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS
+}
-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=portmap
DEFAULT=/etc/default/$BIN
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- *)
- echo "usage: $0 start"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS
+}
+
+stop() {
+ killall $BIN
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=pptpd
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $RUN_D
- for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
- insmod $m >/dev/null 2>&1
- done
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $RUN_D
+ for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
+ insmod $m >/dev/null 2>&1
+ done
+ $BIN $OPTIONS
+}
-exit $?
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-case "$1" in
- start)
+start() {
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
mkdir -p /var/log
mkdir -p /var/run
/usr/sbin/radvd
- ;;
+}
- stop)
+stop() {
killall radvd
echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
- ;;
-
- restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
- ;;
-esac
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
RARPD=/usr/sbin/rarpd
DEFAULT=/etc/default/rarpd
[ -f $DEFAULT ] && . $DEFAULT
-$RARPD $OPTIONS
+start() {
+ $RARPD $OPTIONS
+}
+stop() {
+ killall rarpd
+}
-#! /bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=reaim
DESC="Transparent proxy for IM behind NAT"
-. /etc/functions.sh
-WAN=$(nvram get wan_ifname)
IPT=/usr/sbin/iptables
-case "$1" in
- start)
- if [ -e /var/run/$NAME.pid ]; then
- echo "$DESC: $NAME already started."
- exit 0
- fi
- echo -n "Starting $DESC: $NAME"
- $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
- test -e /var/run/$NAME.pid || touch /var/run/$NAME.pid
- /usr/sbin/$NAME
- echo "."
- ;;
-
- stop)
- if [ ! -e /var/run/$NAME.pid ]; then
- echo "$DESC: $NAME is not running."
- exit 0
- fi
- echo -n "Stopping $DESC: $NAME"
- killall $NAME
- rm -f /var/run/$NAME.pid
-
- echo "."
- ;;
-
- restart|force-reload)
- if [ ! -e /var/run/$NAME.pid ]; then
- $0 start
- exit 0
- fi
- echo -n "Restarting $DESC: $NAME"
- $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
- $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
- killall $NAME
- sleep 1
- /usr/sbin/$NAME
- echo "."
- ;;
-
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
-
-esac
-
-exit 0
+include /lib/network
+scan_interfaces
+config_get WAN wan ifname
+
+set_rules() {
+ [ -z "$WAN" ] && exit
+ $IPT $1 input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
+ $IPT $1 input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
+ $IPT $1 input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
+ $IPT $1 input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
+}
+
+start() {
+ if [ -e /var/run/$NAME.pid ]; then
+ echo "$DESC: $NAME already started."
+ exit 0
+ fi
+ echo -n "Starting $DESC: $NAME"
+
+ set_rules -A
+ test -e /var/run/$NAME.pid || touch /var/run/$NAME.pid
+ /usr/sbin/$NAME
+ echo "."
+}
+
+stop() {
+ set_rules -D 2>/dev/null >/dev/null
+
+ if [ ! -e /var/run/$NAME.pid ]; then
+ echo "$DESC: $NAME is not running."
+ exit 0
+ fi
+ echo -n "Stopping $DESC: $NAME"
+
+ killall $NAME
+ rm -f /var/run/$NAME.pid
+
+ echo "."
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/rp-l2tpd
RUN_D=/var/run
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- l2tpd $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ l2tpd $OPTIONS
+}
+
+stop() {
+ killall l2tpd
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-case "$1" in
- start|stop)
- adsl-$1
- ;;
- *)
- echo "usage: $0 {start|stop}"
- exit 1
-esac
+start() {
+ adsl-start
+}
+
+stop() {
+ adsl-stop
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/pppoe-relay
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- pppoe-relay $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ pppoe-relay $OPTIONS
+}
+
+stop() {
+ killall pppoe-relay
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/pppoe-server
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- pppoe-server $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ pppoe-server $OPTIONS
+}
-exit $?
+stop() {
+ killall pppoe-server
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
SMBD_PID_F=$RUN_D/smbd.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $RUN_D
- nmbd -D $NMBD_OPTIONS
- smbd -D $SMBD_OPTIONS
- ;;
- stop)
- [ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID_F)
- [ -f $NMBD_PID_F ] && kill $(cat $NMBD_PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $RUN_D
+ nmbd -D $NMBD_OPTIONS
+ smbd -D $SMBD_OPTIONS
+}
+stop() {
+ [ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID_F)
+ [ -f $NMBD_PID_F ] && kill $(cat $NMBD_PID_F)
+}
-exit $?
-#!/bin/sh
-mkdir -p `grep "^scanlogd:" /etc/passwd | cut -d: -f6`
-/usr/sbin/scanlogd
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ mkdir -p `grep "^scanlogd:" /etc/passwd | cut -d: -f6`
+ /usr/sbin/scanlogd
+}
+
+stop() {
+ killall scanlogd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=siproxd
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)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- 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
-if [ -f /etc/srelay.conf ];then
- srelay -c /etc/srelay.conf -r -s
-fi
+start() {
+ if [ -f /etc/srelay.conf ];then
+ srelay -c /etc/srelay.conf -r -s
+ fi
+}
+
+stop() {
+ killall srelay
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=tor
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $LOG_D
- mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $LOG_D
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=ulogd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS
+}
-exit $?
+stop() {
+ killall $BIN
+}
-#!/bin/sh
-. /etc/nvram.sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
-ddnsupdate=$(nvram get ddns_update)
-[ "$ddnsupdate" = 1 ]&& {
- service=$(nvram get ddns_service)
- uname=$(nvram get ddns_user)
- passwd=$(nvram get ddns_password)
- host=$(nvram get ddns_host)
-
- /usr/bin/updatedd -Y $service -- $uname:$passwd $host
+start() {
+ . /etc/nvram.sh
+
+ ddnsupdate=$(nvram get ddns_update)
+ [ "$ddnsupdate" = 1 ]&& {
+ service=$(nvram get ddns_service)
+ uname=$(nvram get ddns_user)
+ passwd=$(nvram get ddns_password)
+ host=$(nvram get ddns_host)
+
+ /usr/bin/updatedd -Y $service -- $uname:$passwd $host
+ }
}
+stop() {
+ killall updatedd
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=vrrpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
-case $1 in
- start)
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
RUN_D=/var/run/vsftpd
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- vsftpd
- ;;
- *)
- echo "usage: $0 (start)"
- exit 1
-esac
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ vsftpd
+}
-exit $?
+stop() {
+ killall vsftpd
+}
-#!/bin/sh
-/usr/bin/wifidog-init start
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+ /usr/bin/wifidog-init start
+}
+
+stop() {
+ /usr/bin/wifidog-init stop
+}
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/xinetd
RUN_D=/var/run
PID_F=$RUN_D/xinetd.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- [ -d $RUN_D ] || mkdir -p $RUN_D
- xinetd $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ xinetd $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BINARY="/usr/sbin/collectd"
PIDFILE="/var/run/collectd.pid"
DATADIR="/var/lib/collectd"
-[ -x "$BINARY" ] || exit 1;
+start() {
+ [ -x "$BINARY" ] || exit 1;
-if [ -e "$PIDFILE" ]
-then
- kill $(cat "$PIDFILE") 2>/dev/null
- sleep 1
-fi
+ if [ -e "$PIDFILE" ]
+ then
+ kill $(cat "$PIDFILE") 2>/dev/null
+ sleep 1
+ fi
+
+ [ -d "$DATADIR" ] || mkdir -p "$DATADIR";
-[ -d "$DATADIR" ] || mkdir -p "$DATADIR";
+ $BINARY
+}
-$BINARY
+stop() {
+ kill $(cat "$PIDFILE") 2>/dev/null
+}