From 36b3473d1854d9bc4d9ed5d0bec578ca076f556e Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Thu, 29 Apr 2010 18:34:29 +0200 Subject: bug if statement changed, so it works if only one plugin installed --- .../vmchooser/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- .../plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then -- cgit v1.2.3-55-g7522