olsrd.init add virtual interface name
authorFlorian Fainelli <florian@openwrt.org>
Sat, 4 Sep 2010 18:27:16 +0000 (18:27 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sat, 4 Sep 2010 18:27:16 +0000 (18:27 +0000)
This patch add interface name handling for the NonOlsrIf Option in olsrd init script.
e.g. NonOlsrIf=lan and not NonOlsrIf=eth0

Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
SVN-Revision: 22918

net/olsrd/Makefile
net/olsrd/files/olsrd.init

index 84ed3498f174c97191b15a3a998705dd8e0977e1..4f8dc4b34ee9f09095fa5727262fc5fded430e61 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=olsrd
 PKG_VERSION:=0.6.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6
index 9b0dc02c8dc59890bda6c11d061080210cd53025..67b5bbf88af8baaa38428b5f3f3c7c7c817cfe99 100644 (file)
@@ -171,6 +171,19 @@ olsrd_write_plparam() {
                shift
                value="$*"
        fi
+       if [ "$option" = 'NonOlsrIf' ]; then
+               if validate_varname "$value"; then
+                       if get_ifname "$value"; then
+                               ifname="$IFNAME"
+                               echo "Info: mdns Interface '$value' ifname '$ifname' found" 1>&2
+                       else
+                               echo "Warning: mdns Interface '$value' not found, skipped" 1>&2
+                       fi
+               else
+                       warning_invalid_value olsrd "$cfg" "NonOlsrIf"
+               fi
+               [ -z "$ifname" ] || value=$ifname
+       fi
 
        echo -n "${N}${param}PlParam \"$option\" \"$value\""