From: <abe...@us...> - 2017-05-23 23:41:14
|
Revision: 8329 http://sourceforge.net/p/astlinux/code/8329 Author: abelbeck Date: 2017-05-23 23:41:11 +0000 (Tue, 23 May 2017) Log Message: ----------- Replace Free memory with Available as per /proc/meminfo, console alert page and web interface Status tab Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/status.inc branches/1.0/package/webinterface/altweb/common/version.php branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2017-05-23 21:35:41 UTC (rev 8328) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2017-05-23 23:41:11 UTC (rev 8329) @@ -610,15 +610,15 @@ echo '<tr ', ($i++ % 2 == 0) ? 'class="dtrow0"' : 'class="dtrow1"', '>'; echo '<td class="dialogText" style="text-align: right; font-weight: bold;">', 'System Time:', '</td>'; echo '<td style="text-align: left;">', date('l, M d H:i:s T Y'), '</td>'; -$line = trim(shell_exec('grep "^Mem[TF]" /proc/meminfo 2>/dev/null')); +$line = trim(shell_exec('grep "^Mem[TA]" /proc/meminfo 2>/dev/null')); $mstr = ''; -if (($pos = strpos($line, 'MemTotal')) !== FALSE) { +if (($pos = strpos($line, 'MemTotal:')) !== FALSE) { $mem = (int)(((int)trim(substr($line, $pos + 9)) + 512)/1024); $mstr .= $mem.' MB, '; } -if (($pos = strpos($line, 'MemFree')) !== FALSE) { - $mem = (int)(((int)trim(substr($line, $pos + 8)) + 512)/1024); - $mstr .= 'Free '.$mem.' MB'; +if (($pos = strpos($line, 'MemAvailable:')) !== FALSE) { + $mem = (int)(((int)trim(substr($line, $pos + 13)) + 512)/1024); + $mstr .= 'Available '.$mem.' MB'; } echo '<td class="dialogText" style="text-align: right; font-weight: bold;">', 'RAM Memory:', '</td>'; echo '<td style="text-align: left;">', $mstr, '</td>'; Modified: branches/1.0/package/webinterface/altweb/common/version.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/version.php 2017-05-23 21:35:41 UTC (rev 8328) +++ branches/1.0/package/webinterface/altweb/common/version.php 2017-05-23 23:41:11 UTC (rev 8329) @@ -1,6 +1,6 @@ <?php // version.php for AstLinux Alternate Web Interface -$GUI_VERSION = '1.8.40'; +$GUI_VERSION = '1.8.41'; ?> Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2017-05-23 21:35:41 UTC (rev 8328) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2017-05-23 23:41:11 UTC (rev 8329) @@ -18,7 +18,7 @@ welcome_msg() { - local asterisk="" memtotal memfree board release + local asterisk="" memtotal memavail board release if [ -x /usr/sbin/asterisk ]; then asterisk="$(/usr/sbin/asterisk -V)" @@ -25,7 +25,7 @@ fi memtotal="$(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" - memfree="$(awk '/^MemFree:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" + memavail="$(awk '/^MemAvailable:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" board="$(cat /proc/cmdline | sed -n -r -e 's:^.* astlinux=([^ ]+).*$:\1:p')" if [ "$board" = "geni586" -o "$board" = "genx86_64" ]; then @@ -43,7 +43,7 @@ Hostname: $HOSTNAME Domain: $DOMAIN Linux: $(uname -r -m) - RAM Memory: $memtotal MB, Free $memfree MB + RAM Memory: $memtotal MB, Available $memavail MB Board Type: $board Interface: $EXTIF (External) IPv4 Address: $(dev_to_ipv4_addresses $EXTIF)${INTIF:+ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |