aboutsummaryrefslogtreecommitdiffstats
path: root/libalpine.sh.in
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@entel.upc.edu>2011-12-30 10:51:38 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2011-12-30 10:14:07 +0000
commite819e2865fbc6a6fa184097ae168dd83811d971c (patch)
tree21dc7412db2d8906d6080c9eab017ea5c0893a66 /libalpine.sh.in
parentce8a18b23231919a8b055126bcf989509e33c25f (diff)
downloadalpine-conf-e819e2865fbc6a6fa184097ae168dd83811d971c.tar.bz2
alpine-conf-e819e2865fbc6a6fa184097ae168dd83811d971c.tar.xz
alpine-conf: modify setup-interfaces to create simple bridges
Modified setup-interfaces to create simple bridges (works only with one interface per bridge). Useful when setting up a Xen system, since interfaces need to be bridged in order for guests to have networking. Some distributions automatically create one bridge for each interface when Xen is installed, but I think this is too aggressive. Changes since v1: * Only ask to bridge interfaces if Xen Dom0 is detected
Diffstat (limited to 'libalpine.sh.in')
-rwxr-xr-xlibalpine.sh.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in
index 36d2a93..8661643 100755
--- a/libalpine.sh.in
+++ b/libalpine.sh.in
@@ -106,4 +106,13 @@ askpassword() {
IFS=$_oifs
}
+# Detect if we are running Xen
+is_xen() {
+ test -d /proc/xen
+}
+# Detect if we are running Xen Dom0
+is_xen_dom0() {
+ is_xen && \
+ grep -q "control_d" /proc/xen/capabilities
+}