Fixed a bug in the newly added virtualization run.sh script to take in all the extra...
authorMadhu Venugopal <mavenugo@gmail.com>
Thu, 12 Dec 2013 11:49:35 +0000 (03:49 -0800)
committerMadhu Venugopal <mavenugo@gmail.com>
Thu, 12 Dec 2013 11:53:15 +0000 (03:53 -0800)
Change-Id: I4d53d85d8f59075a91168f74f4046d92cf50ab37
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
distributions/virtualization/src/assemble/resources/run.sh

index af97531af6c0a47781b458e7fd1c5f023cd09085..6d04057f42026b7e2874423ffc6f562094ec362a 100755 (executable)
@@ -1,18 +1,25 @@
 #!/bin/bash
 
 function usage {
-    echo "Please select one of the 3 supported Virtualization technology : \"run.sh -virt [ovsdb | opendove | vtn]\""
+    echo "Please select one of the 3 supported Virtualization technology : \"$0 -virt [ovsdb | opendove | vtn]\""
     exit 1
 }
+
+virtIndex=0
 while true ; do
-    case "$1" in
-        -virt) shift; virt="$1"; shift ;;
+    (( i += 1 ))
+    case "${@:$i:1}" in
+        -virt) virtIndex=$i ;;
         "") break ;;
-        *) shift ;;
     esac
 done
 
 # Virtualization edition select
+if [ ${virtIndex} -eq 0 ]; then
+    usage
+fi
+
+virt=${@:$virtIndex+1:1}
 if [ "${virt}" == "" ]; then
     usage
 else
@@ -27,4 +34,4 @@ else
     fi
 fi
 
-./run.base.sh -Dfelix.fileinstall.filter="^(?!org.opendaylight.(${ODL_VIRT_FILTER})).*" "$@"
+./run.base.sh -Dfelix.fileinstall.filter="^(?!org.opendaylight.(${ODL_VIRT_FILTER})).*" "${@:1:$virtIndex-1}" "${@:virtIndex+2}"