Changeset 31968


Ignore:
Timestamp:
2012-05-29T03:11:32+02:00 (6 years ago)
Author:
jow
Message:

[packages] rarpd: use network.sh to find devices

Location:
packages/net/rarpd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/rarpd/Makefile

    r29215 r31968  
    11# 
    2 # Copyright (C) 2006-2011 OpenWrt.org 
     2# Copyright (C) 2006-2012 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=rarpd 
    1111PKG_VERSION:=1.1 
    12 PKG_RELEASE:=3 
     12PKG_RELEASE:=4 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
  • packages/net/rarpd/files/rarpd.init

    r29215 r31968  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2006-2011 OpenWrt.org 
     2# Copyright (C) 2006-2012 OpenWrt.org 
    33 
    44START=50 
     
    2727} 
    2828 
    29 config_get_ifname() { 
    30         local var="$1" 
    31         local section="$2" 
    32         local option="$3" 
    33         local val="$4" 
    34         local _val 
    35         config_get _val "$section" "$option" "$val" 
    36         [ -n "$_val" ] && config_get "$var" "$_val" 'ifname' "$_val" 
    37 } 
    38  
    3929section_enabled() { 
    4030        local enabled 
     
    4636        local section="$1" 
    4737        local if 
     38        local dev 
    4839        local args 
    4940 
    5041        section_enabled "$section" || return 1 
    5142 
    52         config_get_ifname if "$section" 'interface' 'lan' 
    53         args="-n -i $if" 
    54         append_string args "$section" 'ethers' '-e' 
    55         append_bool args "$section" 'verbose' '-v' 
     43        config_get if "$section" 'interface' 'lan' 
     44        network_get_device dev "$if" && { 
     45                args="-n -i $if" 
     46                append_string args "$section" 'ethers' '-e' 
     47                append_bool args "$section" 'verbose' '-v' 
    5648 
    57         SERVICE_PID_FILE="/var/run/rarpd-${if}.pid" 
    58         service_start /usr/sbin/rarpd $args 
     49                SERVICE_PID_FILE="/var/run/rarpd-${if}.pid" 
     50                service_start /usr/sbin/rarpd $args 
     51        } 
    5952} 
    6053 
     
    6356        local id 
    6457        local if 
     58        local dev 
    6559 
    6660        section_enabled "$section" || return 1 
    6761 
    68         config_get_ifname if "$section" 'interface' 'lan' 
     62        config_get if "$section" 'interface' 'lan' 
     63        network_get_device dev "$if" 
    6964 
    7065        SERVICE_PID_FILE="/var/run/rarpd-${if}.pid" 
     
    7368 
    7469start() { 
    75         include /lib/network 
    76         scan_interfaces 
     70        . /lib/functions/network.sh 
    7771        config_load 'rarpd' 
    7872        config_foreach start_instance 'rarpd' 
     
    8074 
    8175stop() { 
    82         include /lib/network 
    83         scan_interfaces 
     76        . /lib/functions/network.sh 
    8477        config_load 'rarpd' 
    8578        config_foreach stop_instance 'rarpd' 
Note: See TracChangeset for help on using the changeset viewer.