Permalink
Browse files

Reports the network backend (bridge) in use by dom0 as configured by …

…xe-switch-network-backend.
  • Loading branch information...
1 parent ba97637 commit 74b87a683d2b471da7a133ca54a28efee4d3adf1 Zoltan Kiss committed Mar 7, 2012
Showing with 31 additions and 0 deletions.
  1. +31 −0 scripts/xe-get-network-backend
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+#########################################################################
+# Script to report which network backend is in use
+# (Linux bridge or Open vSwitch)
+#
+# Usage:
+# xe-get-network-backend
+#
+# Output:
+# "bridge" - Linux bridge in use
+# "openvswitch" - Open vSwitch in use
+#########################################################################
+
+set -e
+
+backend=$(cat /etc/xensource/network.conf)
+
+case "$backend" in
+ bridge|openvswitch)
+ ;;
+ vswitch)
+ backend=openvswitch
+ ;;
+ *)
+ echo "Invalid network backend: $backend" >&2
+ exit 1
+ ;;
+esac
+
+echo $backend

0 comments on commit 74b87a6

Please sign in to comment.