summaryrefslogtreecommitdiffstats
path: root/etc/rc.php_ini_setup
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2010-05-14 15:06:48 +0200
committersmos <seth.mos@dds.nl>2010-05-14 15:06:48 +0200
commit839cad07a34518c02de398d6fd117d8592ea2ffe (patch)
treeb7d5698a1b3d1b655ebbe67bf1367d47bdbb9c4c /etc/rc.php_ini_setup
parent08825acc2c6fff6bb5ea090a3a9544cd495ea32c (diff)
downloadpfsense-839cad07a34518c02de398d6fd117d8592ea2ffe.zip
pfsense-839cad07a34518c02de398d6fd117d8592ea2ffe.tar.gz
Improve the parsing of the memory value, use the reported amount of bytes, divide to get megabytes and get the 1st result. Ticket #526
Diffstat (limited to 'etc/rc.php_ini_setup')
-rwxr-xr-xetc/rc.php_ini_setup4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup
index 2a0a433..5d7de54 100755
--- a/etc/rc.php_ini_setup
+++ b/etc/rc.php_ini_setup
@@ -31,9 +31,9 @@ EXTENSIONSDIR="/usr/local/lib/php/20060613/"
# Grab amount of memory that is detected
if [ -f /var/log/dmesg.boot ]; then
- AVAILMEM=`/bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1`
+ AVAILMEM=`/bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'`
else
- AVAILMEM=`/sbin/dmesg -a |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1`
+ AVAILMEM=`/sbin/dmesg -a |/usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'`
fi
# Calculate APC SHM size according
OpenPOWER on IntegriCloud