diff options
author | Roger Pau Monne <roger.pau@entel.upc.edu> | 2011-12-30 10:51:38 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-12-30 10:14:07 +0000 |
commit | e819e2865fbc6a6fa184097ae168dd83811d971c (patch) | |
tree | 21dc7412db2d8906d6080c9eab017ea5c0893a66 /libalpine.sh.in | |
parent | ce8a18b23231919a8b055126bcf989509e33c25f (diff) | |
download | alpine-conf-e819e2865fbc6a6fa184097ae168dd83811d971c.zip |
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-x | libalpine.sh.in | 9 |
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 +} |