From 0d60f50a230d030ee4ce128e9afc3391ff1a1d14 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Thu, 3 Dec 2009 15:58:36 +0100 Subject: Simplify and fix available memory calculation to fix shell script errors on boot. Fix spelling error in comment --- etc/rc.php_ini_setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'etc/rc.php_ini_setup') diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup index 5cb7743..ecefefc 100755 --- a/etc/rc.php_ini_setup +++ b/etc/rc.php_ini_setup @@ -29,11 +29,11 @@ PLATFORM=`cat /etc/platform` EXTENSIONSDIR="/usr/local/lib/php/20060613/" -# Grab amount of memory that is deteceted +# Grab amount of memory that is detected if [ -f /var/log/dmesg.boot ]; then - AVAILMEM=`/bin/cat /var/log/dmesg.boot | /usr/bin/grep "memory" | /usr/bin/grep "avail" | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d'M' -f1` + AVAILMEM=`/bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1` else - AVAILMEM=`/sbin/dmesg -a | /usr/bin/grep "memory" | /usr/bin/grep "avail" | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d'M' -f1` + AVAILMEM=`/sbin/dmesg -a |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1` fi # Calculate APC SHM size according -- cgit v1.1