1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008-2013 OpenWrt.org
4 .
$IPKG_INSTROOT/lib
/functions
/olsrd.sh
10 CONF
=/var
/etc
/$OLSRD.conf
11 PID
=/var
/run
/olsrd.pid
14 olsrd_generate_config
$OLSRD
17 procd_set_param
command "$BIN"
18 procd_append_param
command -f ${CONF}
19 procd_append_param
command -nofork
20 procd_append_param
command -pidfile ${PID}
22 # restart if olsrd dies
23 procd_set_param respawn
25 # automatically restart olsrd if generated cfg has changed
26 procd_set_param
file $CONF
28 procd_set_param pidfile
$PID
32 olsrd_setup_smartgw_rules
36 # restart on ifup interface events
37 for n
in $
(olsrd_list_configured_interfaces
$OLSRD); do
38 procd_add_reload_interface_trigger
$n /etc
/init.d
/$OLSRD reload