Bug #526
closedbug in /etc/rc.php_ini_setup
0%
Description
There looks like bug in /etc/rc.php_ini_setup.
Faulty code is:
- 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`
else
AVAILMEM=`/sbin/dmesg -a |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1`
fi
Above code produces following output in RouterStation Pro:
[2.0-BETA1][root@pfsense.mobicom.mn]/root(2): /bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1
118MB)
Old code still works without a problem:
[2.0-BETA1][root@pfsense.mobicom.mn]/root(3): cat /var/log/dmesg.boot | grep "memory" | grep "avail" | awk '{ print $5 }' | cut -d'(' -f2 | cut -d'M' -f1
118
Updated by Chris Buechler over 14 years ago
- Target version set to 2.0
- Affected Version set to 2.0
Updated by Seth Mos over 14 years ago
- Status changed from New to Feedback
Changed the used awk function to use the byte value and calculate from there.
Alternatively. Provide the strong from
dmesg|grep "avail memory"
Updated by Ganbold Ts over 14 years ago
works here.
beastie# /bin/cat /var/run/dmesg.boot | /usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'
1937
beastie# /sbin/dmesg -a |/usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'
1937
It can be closed.
Updated by Chris Buechler over 14 years ago
- Status changed from Feedback to Resolved