local i=0
local interface
- while interface="$( uci -q get olsrd.@Interface[$i].interface )"; do {
- case "$( uci -q get olsrd.@Interface[$i].ignore )" in
+ while interface="$( uci -q get $OLSRD.@Interface[$i].interface )"; do {
+ case "$( uci -q get $OLSRD.@Interface[$i].ignore )" in
1|on|true|enabled|yes)
# is disabled
;;
olsrd_interface_already_in_config()
{
# e.g.: 'Interface "eth0.1" "eth0.2" "wlan0"'
- if grep -s ^'Interface ' '/var/etc/olsrd.conf' | grep -q "\"$DEVICE\""; then
+ if grep -s ^'Interface ' '/var/etc/$OLSRD.conf' | grep -q "\"$DEVICE\""; then
logger -t olsrd_hotplug -p daemon.debug "[OK] already_active: '$INTERFACE' => '$DEVICE'"
return 0
else
}
} done
- logger -t olsrd_hotplug -p daemon.debug "[OK] interface '$INTERFACE' => '$DEVICE' not used for olsrd"
+ logger -t olsrd_hotplug -p daemon.debug "[OK] interface '$INTERFACE' => '$DEVICE' not used for $OLSRD"
return 1
}
ifup)
# only work after the first normal startup
# also: no need to test, if enabled
- [ -e '/var/etc/olsrd.conf' ] && {
+ OLSRD=olsrd4
+ [ -e "/var/etc/$OLSRD.conf" ] && {
# INTERFACE = e.g. 'wlanadhocRADIO1' or 'cfg144d8f'
# DEVICE = e.g. 'wlan1-1'
olsrd_interface_needs_adding && {
- . /etc/rc.common /etc/init.d/olsrd restart
+ . /etc/rc.common /etc/init.d/$OLSRD restart
+ }
+ }
+
+ OLSRD=olsrd6
+ [ -e "/var/etc/$OLSRD.conf" ] && {
+ olsrd_interface_needs_adding && {
+ . /etc/rc.common /etc/init.d/$OLSRD restart
}
}
;;