Skip to content
Snippets Groups Projects
Commit 108f98b6 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check RAM availability before install of matrix

parent 5b9132c7
No related branches found
No related tags found
No related merge requests found
......@@ -452,12 +452,7 @@ function install_etherpad {
exit 7359
fi
# Check the amount of RAM
ram_available=$(grep MemTotal /proc/meminfo | awk '{print $2}')
if [ $ram_available -lt 2000000 ]; then
echo $'Need at least 2GB RAM to install etherpad'
exit 783524
fi
check_ram_availability 2
if [ -f $IMAGE_PASSWORD_FILE ]; then
ETHERPAD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
......
......@@ -621,6 +621,8 @@ function install_home_server {
}
function install_matrix {
check_ram_availability 1.5
if [ ! -d $INSTALL_DIR ]; then
mkdir -p $INSTALL_DIR
fi
......
......@@ -1028,4 +1028,15 @@ function combine_all_scripts {
done
}
function check_ram_availability {
minimum_ram_gb="$1"
minimum_ram_bytes=$((minimum_ram_gb * 1024 * 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"
exit 783524
fi
}
# NOTE: deliberately no exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment