Switch to MB so that RAM requirements can be more granular

This commit is contained in:
Bob Mottram 2017-06-20 15:01:40 +01:00
parent f4329a1b88
commit c0f118250e
3 changed files with 5 additions and 5 deletions

View File

@ -452,7 +452,7 @@ function install_etherpad {
exit 7359 exit 7359
fi fi
check_ram_availability 2 check_ram_availability 2000
if [ -f $IMAGE_PASSWORD_FILE ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"

View File

@ -626,7 +626,7 @@ function install_home_server {
} }
function install_matrix { function install_matrix {
check_ram_availability 2 check_ram_availability 1500
if [ ! -d $INSTALL_DIR ]; then if [ ! -d $INSTALL_DIR ]; then
mkdir -p $INSTALL_DIR mkdir -p $INSTALL_DIR

View File

@ -1029,12 +1029,12 @@ function combine_all_scripts {
} }
function check_ram_availability { function check_ram_availability {
minimum_ram_gb="$1" minimum_ram_MB="$1"
minimum_ram_bytes=$((minimum_ram_gb * 1024 * 1024)) minimum_ram_bytes=$((minimum_ram_gb * 1024))
ram_available=$(grep MemTotal /proc/meminfo | awk '{print $2}') ram_available=$(grep MemTotal /proc/meminfo | awk '{print $2}')
if [ $ram_available -lt $minimum_ram_bytes ]; then if [ $ram_available -lt $minimum_ram_bytes ]; then
echo $"Need at least ${minimum_ram_gb}GB RAM to install this app" echo $"Need at least ${minimum_ram_gb}MB RAM to install this app"
exit 783524 exit 783524
fi fi
} }