Project

General

Profile

Actions

Bug #526

closed

bug in /etc/rc.php_ini_setup

Added by Ganbold Ts over 14 years ago. Updated over 14 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
04/19/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.0
Affected Architecture:

Description

There looks like bug in /etc/rc.php_ini_setup.
Faulty code is:

  1. 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(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(3): cat /var/log/dmesg.boot | grep "memory" | grep "avail" | awk '{ print $5 }' | cut -d'(' -f2 | cut -d'M' -f1
118

Actions

Also available in: Atom PDF