3 alias debug
=${DEBUG:-:}
5 # allow env to override nvram
8 get
) eval "echo \${NVRAM_$2:-\$(command nvram get $2)}";;
12 .
/etc
/nvram.overrides
16 ifconfig
"$1" >&- 2>&- ||
17 [ "${1%%[0-9]}" = "br" ] ||
19 [ "${1%%[0-9]}" = "vlan" ] && (
21 hwname
=$
(nvram get vlan
${i}hwname
)
22 hwaddr
=$
(nvram get
${hwname}macaddr
)
23 [ -z "$hwaddr" ] && return 1
25 vif
=$
(ifconfig
-a |
awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE
=1)
26 debug
"# vlan$i => $vif"
28 $DEBUG ifconfig
$vif up
29 $DEBUG vconfig add
$vif $i 2>&-
32 { debug
"# missing interface '$1' ignored"; false
; }
38 c
=((c
>> 1)&0x55555555)+(c
&0x55555555),
39 c
=((c
>> 2)&0x33333333)+(c
&0x33333333),
40 c
=((c
>> 4)&0x0f0f0f0f)+(c
&0x0f0f0f0f),
41 c
=((c
>> 8)&0x00ff00ff)+(c
&0x00ff00ff),
42 c
=((c
>>16)&0x0000ffff)+(c
&0x0000ffff)
51 set $
(echo $1 |
tr '\.' ' ')
52 echo $
(($1<<24|$2<<16|$3<<8|$4))
56 echo $(($1>>24&255)).$
(($1>>16&255)).$
(($1>>8&255)).$
(($1&255))
This page took 0.043605 seconds and 5 git commands to generate.