Files
webgui/plugins/dynamix/include/CheckPort.php
bergware b6ab3677e2 Added "eth0 down" detection and notice
Displays a message in the footer when eth0 is down
2016-06-06 08:44:22 +02:00

19 lines
572 B
PHP

<?PHP
/* Copyright 2016, Bergware International.
* Copyright 2016, Lime Technology
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<?
$port = $_POST['port'] ?: 'eth0';
if (exec("ip link show $port|grep -om1 'NO-CARRIER'")) {
echo "<b>Interface $port is down. Check cable!</b>";
}
?>