diff options
author | Roy Marples <roy@marples.name> | 2007-11-29 11:23:06 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-11-29 11:23:06 +0000 |
commit | 82df7e4584282896a0618f14cca2dd3f3d23e8a2 (patch) | |
tree | 05a0c01d32adbbb2df8d833b97918454a3178a04 /net.Linux | |
parent | 50161bef0e27ca235d876b888ae5abcafbec2ac7 (diff) |
Use shorthand for loops
Diffstat (limited to 'net.Linux')
-rw-r--r-- | net.Linux/bridge.sh | 2 | ||||
-rw-r--r-- | net.Linux/iwconfig.sh | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/net.Linux/bridge.sh b/net.Linux/bridge.sh index 6c3019bc..12c77768 100644 --- a/net.Linux/bridge.sh +++ b/net.Linux/bridge.sh @@ -112,7 +112,7 @@ bridge_post_stop() { # Work out if we're added to a bridge for removal or not eval set -- $(brctl show 2>/dev/null | sed -e "s/'/'\\\\''/g" -e "s/$/'/g" -e "s/^/'/g") local line= - for line in "$@"; do + for line; do set -- ${line} if [ "$3" = "${IFACE}" ]; then iface=$1 diff --git a/net.Linux/iwconfig.sh b/net.Linux/iwconfig.sh index 82162a41..366071e4 100644 --- a/net.Linux/iwconfig.sh +++ b/net.Linux/iwconfig.sh @@ -122,7 +122,7 @@ iwconfig_get_wep_key() { else set -- ${key} local x= e=false - for x in "$@"; do + for x; do if [ "${x}" = "enc" ]; then e=true break @@ -373,7 +373,7 @@ iwconfig_scan() { APS=-1 eval set -- ${scan} - for line in "$@"; do + for line; do case "${line}" in *Address:*) APS=$((${APS} + 1)) @@ -499,7 +499,7 @@ iwconfig_scan() { eval set -- $(_flatten_array "blacklist_aps_${IFVAR}") [ $# = 0 ] && eval set -- $(_flatten_array "blacklist_aps") - for x in "$@"; do + for x; do if [ "${x}" = "${s}" ]; then ewarn "${s} has been blacklisted - not connecting" unset SSID_${i} MAC_${i} CHAN_${i} QUALITY_${i} ENC_${i} @@ -516,7 +516,7 @@ iwconfig_force_preferred() { [ $# = 0 ] && return 1 ewarn "Trying to force preferred in case they are hidden" - for ssid in "$@"; do + for ssid; do local found_AP=false i=0 e= while [ ${i} -le ${APS} ]; do eval e=\$SSID_${i} @@ -541,7 +541,7 @@ iwconfig_connect_preferred() { eval set -- $(_flatten_array "preferred_aps_${IFVAR}") [ $# = 0 ] && eval set -- $(_flatten_array "preferred_aps") - for ssid in "$@"; do + for ssid; do unset IFS i=0 while [ ${i} -le ${APS} ]; do @@ -571,7 +571,7 @@ iwconfig_connect_not_preferred() { if [ -n "${e}" ]; then eval set -- $(_flatten_array "preferred_aps_${IFVAR}") [ $# = 0 ] && eval set -- $(_flatten_array "preferred_aps") - for ssid in "$@"; do + for ssid; do if [ "${e}" = "${ssid}" ]; then pref=true break |