From: <abe...@us...> - 2014-08-17 18:52:02
|
Revision: 6635 http://sourceforge.net/p/astlinux/code/6635 Author: abelbeck Date: 2014-08-17 18:51:59 +0000 (Sun, 17 Aug 2014) Log Message: ----------- web interface, Network tab, rewrite getETHinterfaces() so the interface order is not random with the new kernel Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/functions.php branches/1.0/package/webinterface/altweb/common/version.php Modified: branches/1.0/package/webinterface/altweb/common/functions.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/functions.php 2014-08-16 20:11:59 UTC (rev 6634) +++ branches/1.0/package/webinterface/altweb/common/functions.php 2014-08-17 18:51:59 UTC (rev 6635) @@ -344,28 +344,24 @@ // function getETHinterfaces() { $id = 0; - $tmpfile = tempnam("/tmp", "PHP_"); - @exec('grep "^ *[a-z0-9.]*:" /proc/net/dev >'.$tmpfile); - $ph = @fopen($tmpfile, "r"); - while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { - if (($pos = strpos($line, ':')) !== FALSE) { - $eth = substr($line, 0, $pos); - if ($eth !== 'lo' && - strncmp($eth, 'ppp', 3) != 0 && - strncmp($eth, 'tun', 3) != 0 && - strncmp($eth, 'sit', 3) != 0 && - strncmp($eth, 'ip6tun', 6) != 0 && - strncmp($eth, 'dummy', 5) != 0) { + $output = array(); + $cmd = '/sbin/ip -o link show 2>/dev/null | cut -d\':\' -f2'; + @exec($cmd, $output); + foreach ($output as $line) { + $eth = trim($line); + if (($pos = strpos($eth, '@')) !== FALSE) { + $eth = substr($eth, 0, $pos); + } + if ($eth !== 'lo' && + strncmp($eth, 'ppp', 3) && + strncmp($eth, 'tun', 3) && + strncmp($eth, 'sit', 3) && + strncmp($eth, 'ip6tun', 6) && + strncmp($eth, 'dummy', 5)) { $eth_R[$id] = $eth; $id++; - } - } } } - fclose($ph); - @unlink($tmpfile); - return($eth_R); } Modified: branches/1.0/package/webinterface/altweb/common/version.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/version.php 2014-08-16 20:11:59 UTC (rev 6634) +++ branches/1.0/package/webinterface/altweb/common/version.php 2014-08-17 18:51:59 UTC (rev 6635) @@ -1,6 +1,6 @@ <?php // version.php for AstLinux Alternate Web Interface -$GUI_VERSION = '1.8.29'; +$GUI_VERSION = '1.8.30'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |