2007-07-31 21:14:30 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2008-01-24 12:49:24 +00:00
|
|
|
START=90
|
2007-07-31 21:14:30 +00:00
|
|
|
. /lib/config/uci.sh
|
2009-03-09 05:50:38 +00:00
|
|
|
uci_load batmand-adv-userspace
|
2007-07-31 21:14:30 +00:00
|
|
|
start () {
|
2009-03-09 05:50:38 +00:00
|
|
|
interface=$(uci get batmand-adv-userspace.general.interface)
|
2007-07-31 21:14:30 +00:00
|
|
|
if [ "$interface" = "" ]; then
|
|
|
|
echo $1 Error, you must specify at least a network interface
|
|
|
|
exit
|
|
|
|
fi
|
2009-03-09 05:50:38 +00:00
|
|
|
originator_interval=$(uci get batmand-adv-userspace.general.originator_interval)
|
|
|
|
visualisation_srv=$(uci get batmand-adv-space.general.visualisation_srv)
|
2007-07-31 21:14:30 +00:00
|
|
|
batman_args=""
|
|
|
|
|
|
|
|
if [ $originator_interval ]; then
|
|
|
|
batman_args=${batman_args}'-o '$originator_interval' '
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $visualisation_srv ]; then
|
|
|
|
batman_args=${batman_args}'-s '$visualisation_srv' '
|
|
|
|
fi
|
|
|
|
|
|
|
|
batman_args=${batman_args}$interface
|
|
|
|
batmand-adv $batman_args >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
restart () {
|
|
|
|
$0 stop
|
|
|
|
sleep 3
|
|
|
|
$0 start
|
|
|
|
}
|
|
|
|
|
|
|
|
stop () {
|
|
|
|
killall batmand-adv
|
|
|
|
}
|