diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-21 07:47:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-21 08:00:02 +0000 |
commit | 58b1c5cf916324511569f31a3b0adc09d0d23a13 (patch) | |
tree | ade26fffd410b6934d3dc9b864bcf8ab8a58f370 /main/util-vserver | |
parent | 1f57eb60222c4cc7aacdeecae111acf3db74feb0 (diff) | |
download | aports-58b1c5cf916324511569f31a3b0adc09d0d23a13.tar.bz2 aports-58b1c5cf916324511569f31a3b0adc09d0d23a13.tar.xz |
main/util-vserver: allow use bonded and bridge interfaces
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 f2364f452a..59d4ec1203 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 985be9c3ad..8d33f6c081 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 |