diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-02 22:02:43 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-02 22:11:19 +0100 |
commit | cb474e20d6ff923a8f338f26b93234411065ffc0 (patch) | |
tree | 4e3c16c18adcc9fd7b3b58f45064ec752f47485e /libalpine.sh.in | |
parent | 9f65b05ba2b0b291f9973228a5c4395508b95b16 (diff) | |
download | alpine-conf-cb474e20d6ff923a8f338f26b93234411065ffc0.zip |
fix mixed tabs & spaces and surplus empty lines at EOF
Diffstat (limited to 'libalpine.sh.in')
-rw-r--r-- | libalpine.sh.in | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in index 67d7aa1..760eaec 100644 --- a/libalpine.sh.in +++ b/libalpine.sh.in @@ -98,26 +98,26 @@ is_xen_dom0() { # list of available network interfaces that aren't part of any bridge or bond available_ifaces() { - local iflist= ifpath= iface= i= + local iflist= ifpath= iface= i= if ! [ -d /sys/class/net ]; then ip link | awk -F: '$1 ~ /^[0-9]+$/ {printf "%s",$2}' return fi - sorted_ifindexes=$( - for i in /sys/class/net/*/ifindex; do - [ -e "$i" ] || continue - echo -e "$(cat $i)\t$i"; - done | sort -n | awk '{print $2}') - for i in $sorted_ifindexes; do - ifpath=${i%/*} - iface=${ifpath##*/} - # skip interfaces that are part of a bond or bridge - if [ -d "$ifpath"/master/bonding ] || [ -d "$ifpath"/brport ]; then - continue - fi - iflist="${iflist}${iflist:+ }$iface" - done - echo $iflist + sorted_ifindexes=$( + for i in /sys/class/net/*/ifindex; do + [ -e "$i" ] || continue + echo -e "$(cat $i)\t$i"; + done | sort -n | awk '{print $2}') + for i in $sorted_ifindexes; do + ifpath=${i%/*} + iface=${ifpath##*/} + # skip interfaces that are part of a bond or bridge + if [ -d "$ifpath"/master/bonding ] || [ -d "$ifpath"/brport ]; then + continue + fi + iflist="${iflist}${iflist:+ }$iface" + done + echo $iflist } # from OpenBSD installer @@ -168,7 +168,7 @@ isin() { # remove all occurrences of first argument from list formed by # the remaining arguments rmel() { - local _a=$1 _b + local _a=$1 _b shift for _b; do @@ -176,17 +176,17 @@ rmel() { done } -# Issue a read into the global variable $resp. +# Issue a read into the global variable $resp. _ask() { local _redo=0 read resp case "$resp" in - !) echo "Type 'exit' to return to setup." + !) echo "Type 'exit' to return to setup." sh _redo=1 ;; - !*) eval "${resp#?}" + !*) eval "${resp#?}" _redo=1 ;; esac @@ -266,4 +266,3 @@ ask_which() { echo "'$resp' is not a valid choice." done } - |