From ac9279cc0d5a00bc17908b2914941186020cd3ce Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 28 Nov 2007 15:45:03 +0000 Subject: Massive whitespace cleanup --- net.Linux/ifconfig.sh | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'net.Linux/ifconfig.sh') diff --git a/net.Linux/ifconfig.sh b/net.Linux/ifconfig.sh index 2b1465a2..04a9ec1e 100644 --- a/net.Linux/ifconfig.sh +++ b/net.Linux/ifconfig.sh @@ -42,7 +42,7 @@ _exists() { _ifindex() { local line= i=-2 - while read line ; do + while read line; do i=$((${i} + 1)) [ ${i} -lt 1 ] && continue case "${line}" in @@ -74,11 +74,11 @@ _get_mac_address() { case "${mac}" in - 00:00:00:00:00:00) ;; - 44:44:44:44:44:44) ;; - FF:FF:FF:FF:FF:FF) ;; - "") ;; - *) echo "${mac}"; return 0 ;; + 00:00:00:00:00:00);; + 44:44:44:44:44:44);; + FF:FF:FF:FF:FF:FF);; + "");; + *) echo "${mac}"; return 0;; esac return 1 @@ -102,7 +102,7 @@ _get_inet_addresses() { local iface=${IFACE} i=0 local addrs="$(_get_inet_address)" - while true ; do + while true; do local IFACE="${iface}:${i}" _exists || break local addr="$(_get_inet_address)" @@ -118,14 +118,14 @@ _cidr2netmask() { local octets=$((${cidr} / 8)) local frac=$((${cidr} % 8)) - while [ ${octets} -gt 0 ] ; do + while [ ${octets} -gt 0 ]; do netmask="${netmask}.255" octets=$((${octets} - 1)) done=$((${done} + 1)) done - if [ ${done} -lt 4 ] ; then - while [ ${i} -lt ${frac} ] ; do + if [ ${done} -lt 4 ]; then + while [ ${i} -lt ${frac} ]; do sum=$((${sum} + ${cur})) cur=$((${cur} / 2)) i=$((${i} + 1)) @@ -133,7 +133,7 @@ _cidr2netmask() { netmask="${netmask}.${sum}" done=$((${done} + 1)) - while [ ${done} -lt 4 ] ; do + while [ ${done} -lt 4 ]; do netmask="${netmask}.0" done=$((${done} + 1)) done @@ -143,7 +143,7 @@ _cidr2netmask() { } _add_address() { - if [ "$1" = "127.0.0.1/8" -a "${IFACE}" = "lo" ] ; then + if [ "$1" = "127.0.0.1/8" -a "${IFACE}" = "lo" ]; then ifconfig "${IFACE}" "$@" 2>/dev/null return 0 fi @@ -155,7 +155,7 @@ _add_address() { # IPv4 is tricky - ifconfig requires an aliased device # for multiple addresses local iface="${IFACE}" - if LC_ALL=C ifconfig "${iface}" | grep -Eq "\