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 9113159..110f03b 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) ;;