From 38ed8b5cd794fab8c56eb885903d2ccb314dc830 Mon Sep 17 00:00:00 2001 From: jow Date: Tue, 29 May 2012 00:59:38 +0000 Subject: [PATCH] [packages] olsrd: use network.sh to find devices git-svn-id: svn://svn.openwrt.org/openwrt/packages@31966 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/olsrd/Makefile | 4 ++-- net/olsrd/files/olsrd.init | 29 +++++------------------------ 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/net/olsrd/Makefile b/net/olsrd/Makefile index 0dbf32ce8..052a260ad 100644 --- a/net/olsrd/Makefile +++ b/net/olsrd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2009-2011 OpenWrt.org +# Copyright (C) 2009-2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=olsrd PKG_VERSION:=0.6.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6 diff --git a/net/olsrd/files/olsrd.init b/net/olsrd/files/olsrd.init index ed6455da4..7578316c1 100644 --- a/net/olsrd/files/olsrd.init +++ b/net/olsrd/files/olsrd.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2008-2011 OpenWrt.org +# Copyright (C) 2008-2012 OpenWrt.org START=65 @@ -26,30 +26,12 @@ validate_varname() { return 0 } -validate_ifname() { - local ifname="$1" - [ -z "$ifname" -o "$ifname" != "${ifname%%[!A-Za-z0-9.:_-]*}" ] && return 1 - return 0 -} - validate_olsrd_option() { local str="$1" [ -z "$str" -o "$str" != "${str%%[! 0-9A-Za-z./|:_-]*}" ] && return 1 return 0 } -get_ifname() { - IFNAME= - local interface="$1" - validate_varname "$interface" || return 1 - local ifname - - config_get ifname "$interface" ifname - validate_ifname "$ifname" || return 1 - IFNAME="$ifname" - return 0 -} - system_config() { local cfg="$1" local cfgt @@ -180,8 +162,7 @@ olsrd_write_plparam() { fi if [ "$option" = 'NonOlsrIf' ]; then if validate_varname "$value"; then - if get_ifname "$value"; then - ifname="$IFNAME" + if network_get_device ifname "$value"; then echo "Info: mdns Interface '$value' ifname '$ifname' found" 1>&2 else echo "Warning: mdns Interface '$value' not found, skipped" 1>&2 @@ -495,7 +476,7 @@ olsrd_write_interface() { config_get interfaces "$cfg" interface for interface in $interfaces; do if validate_varname "$interface"; then - if get_ifname "$interface"; then + if network_get_device IFNAME "$interface"; then ifnames="$ifnames \"$IFNAME\"" ifsglobal="$ifsglobal $IFNAME" else @@ -659,8 +640,8 @@ start() { olsrd_update_schema "list" "$@" } - include /lib/network - scan_interfaces + . /lib/functions/network.sh + config_load olsrd reset_cb -- 2.11.0