X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/6f8004f613c150756c62b31518740054d518a651..ab70217680e5b0977900eb0f23276ddd1b16fd8e:/openwrt/package/base-files/default/etc/functions.sh diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index c813e39a6..e7126473f 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -1,4 +1,4 @@ -#!/bin/ash +#!/bin/sh . /etc/nvram.sh alias debug=${DEBUG:-:} @@ -7,23 +7,13 @@ alias debug=${DEBUG:-:} if_valid () ( ifconfig "$1" >&- 2>&- || [ "${1%%[0-9]}" = "br" ] || - { - [ "${1%%[0-9]}" = "vlan" ] && ( - i=${1#vlan} - hwname=$(nvram get vlan${i}hwname) - hwaddr=$(nvram get ${hwname}macaddr) - [ -z "$hwaddr" ] && return 1 - - vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1) - debug "# vlan$i => $vif" - - $DEBUG ifconfig $vif up - $DEBUG vconfig add $vif $i 2>&- - ) - } || { debug "# missing interface '$1' ignored"; false; } ) +hotplug_dev() { + env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug net +} + bitcount () { local c=$1 echo $((