Switch to MB so that RAM requirements can be more granular
This commit is contained in:
parent
f4329a1b88
commit
c0f118250e
|
@ -452,7 +452,7 @@ function install_etherpad {
|
|||
exit 7359
|
||||
fi
|
||||
|
||||
check_ram_availability 2
|
||||
check_ram_availability 2000
|
||||
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
|
|
|
@ -626,7 +626,7 @@ function install_home_server {
|
|||
}
|
||||
|
||||
function install_matrix {
|
||||
check_ram_availability 2
|
||||
check_ram_availability 1500
|
||||
|
||||
if [ ! -d $INSTALL_DIR ]; then
|
||||
mkdir -p $INSTALL_DIR
|
||||
|
|
|
@ -1029,12 +1029,12 @@ function combine_all_scripts {
|
|||
}
|
||||
|
||||
function check_ram_availability {
|
||||
minimum_ram_gb="$1"
|
||||
minimum_ram_bytes=$((minimum_ram_gb * 1024 * 1024))
|
||||
minimum_ram_MB="$1"
|
||||
minimum_ram_bytes=$((minimum_ram_gb * 1024))
|
||||
|
||||
ram_available=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue