cfab3825ed5874b4c15f0c8dbcec2f3823a1d343
[openwrt/svn-archive/archive.git] / net / olsrd / files / olsrd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 START=50
4
5 BIN=olsrd
6 DEFAULT=/etc/default/olsrd
7 RUN_D=/var/run
8 PID_F=$RUN_D/$BIN.pid
9
10 start() {
11 [ -f $DEFAULT ] && . $DEFAULT
12 $BIN -nofork $OPTIONS &
13
14 # write pid file (but strip out own pid ($$))
15 mkdir -p $RUN_D
16 PID=`pidof $BIN`
17 echo ${PID%$$} > $PID_F
18
19
20 }
21
22 stop() {
23 killall olsrd
24 }