4 # Required-Start: $network $remote_fs $syslog
5 # Required-Stop: $network $remote_fs $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: /etc/init.d/olsrd: start olsrd
11 # Based on skeleton script written by Miquel van Smoorenburg <miquels@cistron.nl>.
13 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
15 # by Holger Levsen <debian@layer-acht.org>
17 # Version: 21-Dec-2006
18 # modified: 01-Aug-2007
22 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
23 DAEMON=/usr/sbin/olsrd
27 PID_FILE=/var/run/$NAME.pid
29 test -x $DAEMON || exit 0
31 # Include olsrd defaults if available
32 if [ -f /etc/default/olsrd ] ; then
40 echo -n "Starting $DESC: "
41 start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PID_FILE -- $DAEMON_OPTS &
42 # sleep til olsrd has been started
43 while ! pidof $NAME > /dev/null ; do
47 echo $(pidof $NAME) > $PID_FILE
50 if [ "$START_OLSRD" != "YES" ] ; then exit 0 ; fi
51 if [ $(pidof $NAME) -eq 0 ] ; then
52 echo "$NAME already running, doing nothing."
55 echo -n "Starting $DESC: "
56 start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PID_FILE -- $DAEMON_OPTS &
57 # sleep til olsrd has been started
58 while ! pidof $NAME > /dev/null ; do
62 echo $(pidof $NAME) > $PID_FILE
66 echo -n "Stopping $DESC: "
67 start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE
72 echo -n "Restarting $DESC: "
79 echo "Usage: $N {start|stop|restart}" >&2