2009-03-09 05:50:38 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
START=90
|
|
|
|
. /lib/config/uci.sh
|
2009-03-10 15:48:41 +00:00
|
|
|
uci_load batman-adv-kernelland
|
2009-03-09 05:50:38 +00:00
|
|
|
start () {
|
2009-03-10 15:48:41 +00:00
|
|
|
interfaces=$(uci get batman-adv-kernalland.general.interface)
|
|
|
|
if [ "$interfaces" = "" ]; then
|
2009-03-09 05:50:38 +00:00
|
|
|
echo $1 Error, you must specify at least a network interface
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
for interface in interfaces
|
|
|
|
do
|
|
|
|
echo $interface > /proc/net/batman-adv/interfaces
|
|
|
|
done
|
|
|
|
|
2009-03-10 15:48:41 +00:00
|
|
|
originator_interval=$(uci get batman-adv-kernalland.general.originator_interval)
|
|
|
|
log_level=$(uci get batman-adv-kernalland.general.log_level)
|
2009-03-09 05:50:38 +00:00
|
|
|
|
|
|
|
if [ $originator_interval ]; then
|
|
|
|
echo $originator_interval > /proc/net/batman-adv/originator_interval
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $log_level ]; then
|
|
|
|
echo $log_level > /proc/net/batman-adv/log_level
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
restart () {
|
|
|
|
$0 stop
|
|
|
|
sleep 3
|
|
|
|
$0 start
|
|
|
|
}
|
|
|
|
|
|
|
|
stop () {
|
|
|
|
echo "" > /proc/net/batman-adv/interfaces
|
|
|
|
}
|