3 if [ -f /tmp
/ethernet.state1
]; then
4 rm /tmp
/ethernet.state1
6 if [ -f /tmp
/ethernet.state2
]; then
7 rm /tmp
/ethernet.state2
9 if [ -f /tmp
/ethernet.state3
]; then
10 rm /tmp
/ethernet.state3
13 VWAN
=`nvram get wan_ifname`
14 VPORT
=`nvram get $VWAN'ports' | awk '{print $1}' | sed 's/[^0-9]*//g'`
16 /usr
/sbin
/robocfg showports |
grep Port |
awk '{print $1" "$2" "$3}' > /tmp
/ethernet.state.tmp
19 SWAN
=`cat /tmp/ethernet.state.tmp | grep "Port $VPORT" | awk '{print $3}'`
20 echo "Port 0: $SWAN" > /tmp
/ethernet.state
21 sed -n -e "/Port $VPORT:/!p" /tmp
/ethernet.state.tmp
> /tmp
/ethernet.state1
22 sed -i '/Port 5/d' /tmp
/ethernet.state1
23 sed -i '/Port 8/d' /tmp
/ethernet.state1
26 if [ $
(( `nvram get lan_state` & 4 )) -ne 0 ]; then
27 cat /tmp
/ethernet.state1 |
sort -r >> /tmp
/ethernet.state2
28 exec 0< /tmp
/ethernet.state2
32 STATE
=`echo $line | awk '{print $3}'`
33 echo "Port $NUM: $STATE" >> /tmp
/ethernet.state3
38 exec 0< /tmp
/ethernet.state1
42 STATE
=`echo $line | awk '{print $3}'`
43 echo "Port $NUM: $STATE" >> /tmp
/ethernet.state3
48 cat /tmp
/ethernet.state3
>> /tmp
/ethernet.state
50 if [ -f /tmp
/ethernet.state1
]; then
51 rm /tmp
/ethernet.state1
53 if [ -f /tmp
/ethernet.state2
]; then
54 rm /tmp
/ethernet.state2
56 if [ -f /tmp
/ethernet.state3
]; then
57 rm /tmp
/ethernet.state3