diff options
Diffstat (limited to 'main/util-vserver')
-rw-r--r-- | main/util-vserver/APKBUILD | 4 | ||||
-rw-r--r-- | main/util-vserver/setup-vs-guest | 21 |
2 files changed, 22 insertions, 3 deletions
diff --git a/main/util-vserver/APKBUILD b/main/util-vserver/APKBUILD index f2364f452..59d4ec120 100644 --- a/main/util-vserver/APKBUILD +++ b/main/util-vserver/APKBUILD @@ -2,7 +2,7 @@ pkgname=util-vserver pkgver=0.30.216_pre3029 _realver=${pkgver/_/-} -pkgrel=0 +pkgrel=1 pkgdesc="Linux-VServer admin utilities" url="http://www.nongnu.org/util-vserver/" arch="all" @@ -58,4 +58,4 @@ package() { md5sums="e0775fe6ee9ce390be2be84c94eca4ab util-vserver-0.30.216-pre3029.tar.bz2 fae6626b724dec90a19924d68d355cd2 setup-vs-template -4778b260b0fa8b5ce05d0a64f0b2fb39 setup-vs-guest" +dfd0a543b6dcaeef647ceac0ae103d12 setup-vs-guest" diff --git a/main/util-vserver/setup-vs-guest b/main/util-vserver/setup-vs-guest index 985be9c3a..8d33f6c08 100644 --- a/main/util-vserver/setup-vs-guest +++ b/main/util-vserver/setup-vs-guest @@ -182,11 +182,30 @@ ask_hostname() { done } +available_ifaces() { + local iflist= ifpath= iface= i= + 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 +} + ask_ifaceopts() { # get ip address(es) resp= local ifaceopts= _def= _iface= - local ifaces=$(ip addr | awk -F: '$1 ~ /^[0-9]/ {printf "%s" $2} END {printf "\n"}') + local ifaces=$(available_ifaces) local last_iface=$(echo $ifaces | sed 's/.* //') while [ "$resp" != "done" ]; do if [ -z "$ifaces" ] || [ "$ifaces" = "lo " ] || [ -n "$ifaceopts" ]; then |