[Fusionforge-commits] r12575 - trunk/tests/scripts

Christian Bayle cbayle at fusionforge.org
Fri Mar 4 18:10:21 CET 2011


Author: cbayle
Date: 2011-03-04 18:10:20 +0100 (Fri, 04 Mar 2011)
New Revision: 12575

Modified:
   trunk/tests/scripts/start_lxc.sh
Log:
logic, logic


Modified: trunk/tests/scripts/start_lxc.sh
===================================================================
--- trunk/tests/scripts/start_lxc.sh	2011-03-04 16:51:39 UTC (rev 12574)
+++ trunk/tests/scripts/start_lxc.sh	2011-03-04 17:10:20 UTC (rev 12575)
@@ -18,24 +18,30 @@
 		exit 1
 	else
 		HOST=$1
+		# When HOST is given as an arg, I have to guesse which data to take
+		# depending on the host name
+		case $HOST in
+			*deb*)
+				LXCTEMPLATE=$LXCDEBTEMPLATE
+				IPBASE=$IPDEBBASE
+				VEID=$VEIDDEB
+				IPMASK=$IPDEBMASK
+				IPGW=$IPDEBGW
+				;;
+			*centos*)
+				LXCTEMPLATE=$LXCCOSTEMPLATE
+				IPBASE=$IPCOSBASE
+				VEID=$VEIDCOS
+				IPMASK=$IPCOSMASK
+				IPGW=$IPCOSGW
+				;;
+		esac
 	fi
 fi
-case $HOST in
-	*deb*)
-		LXCTEMPLATE=$LXCDEBTEMPLATE
-		IPBASE=$IPDEBBASE
-		VEID=$VEIDDEB
-		IPMASK=$IPDEBMASK
-		IPGW=$IPDEBGW
-		;;
-	*centos*)
-		LXCTEMPLATE=$LXCCOSTEMPLATE
-		IPBASE=$IPCOSBASE
-		VEID=$VEIDCOS
-		IPMASK=$IPCOSMASK
-		IPGW=$IPCOSGW
-		;;
-esac
+[ -z $IPBASE ] || exit 2
+[ -z $VEID ] || exit 2
+[ -z $IPMASK ] || exit 2
+[ -z $IPGW ] || exit 2
 
 if [ ! -e /usr/lib/lxc/templates/lxc-$LXCTEMPLATE ]
 then 




More information about the Fusionforge-commits mailing list