Changeset 1832

Show
Ignore:
Timestamp:
06/01/11 14:41:45 (2 years ago)
Author:
matthijs
Message:

fonbase: Refactor the switch hotplug script.

It now contains just a single check for the current mode, instead of
two.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/fon/fonbase/files/etc/hotplug.d/switch/10-wanport

    r1831 r1832  
    44uci -P /var/state set fon.${PORT}.duplex=${DUPLEX} 
    55 
    6 [ "${PORT}" == "wan" -a "${RESOLVED}" == "1" ] && { 
    7         M=`uci get fon.wan.mode` 
    8         [ "$M" != "umts" -a "$M" != "wifi" ] && { 
    9                 [ -f "/tmp/run/fonstate.pid" ] && 
    10                          fs -l SwitchWanUp || /etc/fonstated/SwitchWanUp 
    11         } 
     6M=`uci get fon.wan.mode` 
     7[ "$M" != "umts" -a "$M" != "wifi" ] && { 
     8    [ "${PORT}" == "wan" -a "${RESOLVED}" == "1" ] && { 
     9            [ -f "/tmp/run/fonstate.pid" ] && 
     10                     fs -l SwitchWanUp || /etc/fonstated/SwitchWanUp 
     11    } 
     12 
     13    [ "${PORT}" == "wan" -a "${RESOLVED}" == "0" ] && { 
     14            [ -f "/tmp/run/fonstate.pid" ] && 
     15                     fs -l SwitchWanDown || /etc/fonstated/SwitchWanDown 
     16    } 
    1217} 
    13  
    14 [ "${PORT}" == "wan" -a "${RESOLVED}" == "0" ] && { 
    15         M=`uci get fon.wan.mode` 
    16         [ "$M" != "umts" -a "$M" != "wifi" ] && { 
    17                 [ -f "/tmp/run/fonstate.pid" ] && 
    18                          fs -l SwitchWanDown || /etc/fonstated/SwitchWanDown 
    19         } 
    20 }