xenserver: Fix VIF script to work with XenServer 5.5
authorJustin Pettit <jpettit@nicira.com>
Fri, 19 Feb 2010 00:16:56 +0000 (16:16 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 19 Feb 2010 00:17:56 +0000 (16:17 -0800)
xenserver/etc_xensource_scripts_vif

index 91131598b1b56047fb6d6744ac5a89413ed8e251..110f03bfe353fb54d79a9789815efdedbaedcd46 100755 (executable)
@@ -164,7 +164,13 @@ remove_from_bridge()
 
 NETWORK_MODE=$(cat /etc/xensource/network.conf)
 ACTION=$1
-TYPE=$2
+
+# Older versions of XenServer do not pass in the type as an argument
+if [[ $# -lt 2 ]]; then
+    TYPE=vif
+else
+    TYPE=$2
+fi
 
 case $NETWORK_MODE in
     bridge|vswitch) ;;