Changeset 3a3b320 in freewrt


Ignore:
Timestamp:
Jul 11, 2006, 12:35:08 AM (19 years ago)
Author:
Thorsten Glaser <tg@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
257cbc3
Parents:
cd6f8c3
Message:

shrink by using tabs instead of spaces, and no "..." around case argument
hint: read the autoconf texinfo documentation and the mksh manpage and the
O'Reilly korn shell book.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@186 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package/base-files/default/etc/functions.sh

    rcd6f8c3 r3a3b320  
    55# valid interface?
    66if_valid () (
    7   ifconfig "$1" >&- 2>&- ||
    8   [ "${1%%[0-9]}" = "br" ] ||
    9   {
    10     [ "${1%%[0-9]}" = "vlan" ] && (
    11       i=${1#vlan}
    12       hwname=$(nvram get vlan${i}hwname)
    13       hwaddr=$(nvram get ${hwname}macaddr)
    14       [ -z "$hwaddr" ] && return 1
     7        ifconfig "$1" >&- 2>&- ||
     8        [ "${1%%[0-9]}" = "br" ] || {
     9                [ "${1%%[0-9]}" = "vlan" ] && (
     10                        i=${1#vlan}
     11                        hwname=$(nvram get vlan${i}hwname)
     12                        hwaddr=$(nvram get ${hwname}macaddr)
     13                        [ -z "$hwaddr" ] && return 1
    1514
    16       vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
    17       debug "# vlan$i => $vif"
     15                        vif=$(ifconfig -a | awk \
     16                            '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
     17                        debug "# vlan$i => $vif"
    1818
    19       $DEBUG ifconfig $vif up
    20       $DEBUG vconfig add $vif $i 2>&-
    21     )
    22   } ||
    23   { debug "# missing interface '$1' ignored"; false; }
     19                        $DEBUG ifconfig $vif up
     20                        $DEBUG vconfig add $vif $i 2>&-
     21                )
     22        } || { debug "# missing interface '$1' ignored"; false; }
    2423)
    2524
     
    3231        [ -f $pidfile ] && $DEBUG kill $(cat $pidfile)
    3332
    34         case "$1" in
     33        case $1 in
    3534        static)
    3635                ip=$(nvram get ${2}_ipaddr)
Note: See TracChangeset for help on using the changeset viewer.