[packages] olsrd: use network.sh to find devices
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 29 May 2012 00:59:38 +0000 (00:59 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 29 May 2012 00:59:38 +0000 (00:59 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages/net/olsrd@31966 3c298f89-4303-0410-b956-a3cf2f4a3e73

Makefile
files/olsrd.init

index 0dbf32ce84930f080cf6506a1c386f7445fb8e9a..052a260adbdb0fb5b852c39679fb2ce93a7b24c8 100644 (file)
--- a/Makefile
+++ b/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
index ed6455da42241d78dc88f7dbee5ad1e8aba8da3e..7578316c1311be0150e1e6b48e502db80ee092cc 100644 (file)
@@ -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