mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-12 16:14:05 +02:00
more cleanup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@63 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
82ed921569
commit
8f945d8339
@ -23,7 +23,6 @@ if_valid () (
|
|||||||
$DEBUG vconfig add $vif $i 2>/dev/null
|
$DEBUG vconfig add $vif $i 2>/dev/null
|
||||||
}
|
}
|
||||||
ifconfig "$1" >/dev/null 2>&1 || [ "${1%%[0-9]}" = "br" ]
|
ifconfig "$1" >/dev/null 2>&1 || [ "${1%%[0-9]}" = "br" ]
|
||||||
return $?
|
|
||||||
)
|
)
|
||||||
|
|
||||||
wifi () (
|
wifi () (
|
||||||
@ -59,7 +58,7 @@ ifup () (
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if_mac=$(nvram_get ${type}_hwaddr)
|
if_mac=$(nvram_get ${type}_hwaddr)
|
||||||
[ -z "$if_mac" ] || $DEBUG ifconfig $if hw ether $if_mac
|
${if_mac:+$DEBUG ifconfig $if hw ether $if_mac}
|
||||||
|
|
||||||
if_proto=$(nvram_get ${type}_proto)
|
if_proto=$(nvram_get ${type}_proto)
|
||||||
case "$if_proto" in
|
case "$if_proto" in
|
||||||
@ -68,12 +67,8 @@ ifup () (
|
|||||||
if_netmask=$(nvram_get ${type}_netmask)
|
if_netmask=$(nvram_get ${type}_netmask)
|
||||||
if_gateway=$(nvram_get ${type}_gateway)
|
if_gateway=$(nvram_get ${type}_gateway)
|
||||||
|
|
||||||
ipcalc -s "$if_ip" || return
|
$DEBUG ifconfig $if $if_ip ${if_netmask:+netmask $if_netmask} up
|
||||||
ipcalc -s "$if_netmask" || return
|
${if_gateway:+$DEBUG route add default gw $if_gateway}
|
||||||
$DEBUG ifconfig $if $if_ip netmask $if_netmask up
|
|
||||||
|
|
||||||
ipcalc -s "$if_gateway" || return
|
|
||||||
$DEBUG route add default gw $if_gateway
|
|
||||||
|
|
||||||
[ -f /etc/resolv.conf ] && return
|
[ -f /etc/resolv.conf ] && return
|
||||||
|
|
||||||
@ -87,8 +82,7 @@ ifup () (
|
|||||||
if [ -f $pidfile ]; then
|
if [ -f $pidfile ]; then
|
||||||
$DEBUG kill $(cat $pidfile)
|
$DEBUG kill $(cat $pidfile)
|
||||||
fi
|
fi
|
||||||
cmd="udhcpc -i $if -b -p $pidfile &"
|
${DEBUG:-eval} "udhcpc -i $if -b -p $pidfile &"
|
||||||
${DEBUG:-eval} $cmd
|
|
||||||
;;
|
;;
|
||||||
pppoe)
|
pppoe)
|
||||||
if_username=$(nvram_get ppp_username)
|
if_username=$(nvram_get ppp_username)
|
||||||
@ -110,6 +104,5 @@ ifdown () (
|
|||||||
type=$1
|
type=$1
|
||||||
debug "### ifdown $type ###"
|
debug "### ifdown $type ###"
|
||||||
if=$(nvram_get ${type}_ifname)
|
if=$(nvram_get ${type}_ifname)
|
||||||
if_valid $if || return
|
if_valid $if && $DEBUG ifconfig $if down
|
||||||
$DEBUG ifdown $if
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user