From 277145dbfa9e5d6d659c6bad9d611932ff0d76f6 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 4 Sep 2010 18:27:16 +0000 Subject: [PATCH] [package] olsrd.init add virtual interface name 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 git-svn-id: svn://svn.openwrt.org/openwrt/packages/net/olsrd@22918 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- Makefile | 2 +- files/olsrd.init | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 84ed349..4f8dc4b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/files/olsrd.init b/files/olsrd.init index 9b0dc02..67b5bbf 100644 --- a/files/olsrd.init +++ b/files/olsrd.init @@ -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\"" -- 2.35.1