diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-06-23 11:07:55 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-06-23 11:07:55 +0200 |
commit | 77da382737e729ec18b684c84178e2e1498ddff3 (patch) | |
tree | e50928a93c42d65ab5c4f3a3812cfa4ba2ef5bd0 | |
parent | 5ceeeef29b5aef9773782564c94e643296acfeae (diff) | |
download | alpine-conf-77da382737e729ec18b684c84178e2e1498ddff3.tar.bz2 alpine-conf-77da382737e729ec18b684c84178e2e1498ddff3.tar.xz |
libalpine: available_ifaces: fallback to 'ip link' if /sys is not mounted
this makes it work in lxcontainers.
-rw-r--r-- | libalpine.sh.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in index 6c6cc4e..67d7aa1 100644 --- a/libalpine.sh.in +++ b/libalpine.sh.in @@ -99,6 +99,10 @@ is_xen_dom0() { # list of available network interfaces that aren't part of any bridge or bond available_ifaces() { 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 |