X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/6f8004f613c150756c62b31518740054d518a651..4e6ddce407aa82ee2726cb6419050799f228dabd:/openwrt/package/base-files/default/etc/functions.sh?ds=sidebyside 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 $((