The batman-adv init script will query uci (network.$iface.ifname)
to retrieve the interface name to re-use the existing network
configuration system.
The default iface configuration (batman-adv.bat0.interfaces) is
set to 'mesh' which allows to start batman-adv as soon as the
network configuration contains a 'mesh' stanza.
Signed-off-by: Filippo Sallemi <tonyputi@gmail.com>
Signed-off-by: Gioacchino Mazzurco <gmazzurco89@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/packages/net/batman-adv@26719
3c298f89-4303-0410-b956-
a3cf2f4a3e73
- option 'interfaces' 'wlan0'
+ option 'interfaces' 'mesh'
option 'aggregated_ogms'
option 'bonding'
option 'fragmentation'
option 'aggregated_ogms'
option 'bonding'
option 'fragmentation'
+# Copyright (C) 2011 OpenWrt.org
+
START=90
is_module_loaded() {
START=90
is_module_loaded() {
echo Error, you must specify at least a network interface
return
fi
echo Error, you must specify at least a network interface
return
fi
for interface in $interfaces
do
for interface in $interfaces
do
- [ ! -f "/sys/class/net/$interface/batman_adv/mesh_iface" ] && echo "Can't add interface $interface - ignoring" && continue
- echo $meshif > /sys/class/net/$interface/batman_adv/mesh_iface
+ ifname=$(uci -P /var/state get network.$interface.ifname 2>&-)
+ [ ! -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] && {
+ ifname=${interface}
+ [ ! -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] && echo "Can't add interface $ifname - ignoring" && continue
+ }
+
+ echo $meshif > /sys/class/net/$ifname/batman_adv/mesh_iface
done
if [ $orig_interval ]; then
done
if [ $orig_interval ]; then
for iface in $(ls /sys/class/net/*)
do
[ ! -f "$iface/batman_adv/mesh_iface" ] && continue
for iface in $(ls /sys/class/net/*)
do
[ ! -f "$iface/batman_adv/mesh_iface" ] && continue
- [ "$(head -1 $iface/batman_adv/mesh_iface)" != "status: $meshif" ] && continue
+ [ "$(head -1 $iface/batman_adv/mesh_iface)" != "$meshif" ] && continue
echo "none" > $iface/batman_adv/mesh_iface
done
echo "none" > $iface/batman_adv/mesh_iface
done