packages/net/batman-advanced/files/etc/init.d/batman-adv-userspace
marek cebd3edf9d batman makefiles / configs / init scripts revised
vis package added


git-svn-id: svn://svn.openwrt.org/openwrt/packages@15332 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-04-21 19:16:40 +00:00

32 lines
761 B
Bash

#!/bin/sh /etc/rc.common
START=90
. /lib/config/uci.sh
uci_load batman-adv-userspace
start () {
interface=$(uci get batman-adv-userspace.general.interface)
if [ "$interface" = "" ]; then
echo $1 Error, you must specify at least a network interface
exit
fi
originator_interval=$(uci get batman-adv-userspace.general.originator_interval)
visualisation_srv=$(uci get batman-adv-userspace.general.visualisation_srv)
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
}
stop () {
killall batmand-adv
}