mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-09-30 13:50:54 +00:00
Merge 7334dde805
into e931e103fe
This commit is contained in:
commit
1d8acb07db
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
# Are we running as root?
|
# Are we running as root?
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root. Please re-run like this:"
|
echo "This script must be run as root. Please re-run like this:"
|
||||||
@ -26,16 +27,16 @@ fi
|
|||||||
#
|
#
|
||||||
# Skip the check if we appear to be running inside of Vagrant, because that's really just for testing.
|
# Skip the check if we appear to be running inside of Vagrant, because that's really just for testing.
|
||||||
TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}')
|
TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}')
|
||||||
if [ $TOTAL_PHYSICAL_MEM -lt 490000 ]; then
|
if [ "$TOTAL_PHYSICAL_MEM" -lt 490000 ]; then
|
||||||
if [ ! -d /vagrant ]; then
|
if [ ! -d /vagrant ]; then
|
||||||
TOTAL_PHYSICAL_MEM=$(expr \( \( $TOTAL_PHYSICAL_MEM \* 1024 \) / 1000 \) / 1000)
|
TOTAL_PHYSICAL_MEM=$(( TOTAL_PHYSICAL_MEM * 1024 / 1000 / 1000 ))
|
||||||
echo "Your Mail-in-a-Box needs more memory (RAM) to function properly."
|
echo "Your Mail-in-a-Box needs more memory (RAM) to function properly."
|
||||||
echo "Please provision a machine with at least 512 MB, 1 GB recommended."
|
echo "Please provision a machine with at least 512 MB, 1 GB recommended."
|
||||||
echo "This machine has $TOTAL_PHYSICAL_MEM MB memory."
|
echo "This machine has $TOTAL_PHYSICAL_MEM MB memory."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $TOTAL_PHYSICAL_MEM -lt 750000 ]; then
|
if [ "$TOTAL_PHYSICAL_MEM" -lt 750000 ]; then
|
||||||
echo "WARNING: Your Mail-in-a-Box has less than 768 MB of memory."
|
echo "WARNING: Your Mail-in-a-Box has less than 768 MB of memory."
|
||||||
echo " It might run unreliably when under heavy load."
|
echo " It might run unreliably when under heavy load."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user