From 1a45021f030c1ff3a900c75133c4b7ba06559d59 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 10 Nov 2022 10:29:11 +0100 Subject: [vbox-src] Fix broken math expression, use (( )) --- .../vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/modules/vbox-src/data') diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc index d29fac20..6c0a6d7f 100755 --- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc +++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc @@ -107,8 +107,8 @@ set_hardware_limits() { # use HW_CORES not HW_THREADS since virtualbox does not # seem to handle hyperthreading all too well... declare -g CPU_CORES="${HW_CORES:-1}" - [ "${CPU_CORES}" -gt "{MAXCORES}" ] && CPU_CORES="${MAXCORES}" - [ "${VM_MEM}" -gt "${MAXMEM}" ] && VM_MEM="${MAXMEM}" + (( CPU_CORES > MAXCORES )) && CPU_CORES="${MAXCORES}" + (( VM_MEM > MAXMEM )) && VM_MEM="${MAXMEM}" # currently not used, keep the VRAMSize setting from the uploaded configuration declare -rg GUESTVRAM=$MAXVRAM @@ -116,7 +116,7 @@ set_hardware_limits() { # check if shared folders should be activated according # to SHARE_REMAP_MODE set by /opt/openslx/inc/shares VBOX_SHARED_FOLDERS= - if [ "x$SHARED_FOLDERS" != "xFALSE" ] && [ "$SHARE_REMAP_MODE" -gt 1 ]; then + if [ "${SHARED_FOLDERS^^}" = "TRUE" ] && (( SHARE_REMAP_MODE > 1 )); then declare -rg VBOX_SHARED_FOLDERS="1" fi return 0 -- cgit v1.2.3-55-g7522