Revision d237b444
Added by Renato Botelho almost 10 years ago
src/usr/local/www/widgets/widgets/wake_on_lan.widget.php | ||
---|---|---|
57 | 57 |
echo '<td class="listr">' . convert_friendly_interface_to_friendly_descr($wolent['interface']) . '</td>' . "\n"; |
58 | 58 |
|
59 | 59 |
$is_active = exec("/usr/sbin/arp -an |/usr/bin/grep {$wolent['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'"); |
60 |
if($is_active == 1) { |
|
60 |
$status = exec("/usr/sbin/arp -an | /usr/bin/awk '$4 == \"{$wolent['mac']}\" { print $7 }'"); |
|
61 |
if ($status == 'expires') { |
|
61 | 62 |
echo '<td class="listr" align="center">' . "\n"; |
62 | 63 |
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_pass.gif\" alt=\"pass\" /> " . gettext("Online") . "</td>\n"; |
64 |
} else if ($status == 'permanent') { |
|
65 |
echo '<td class="listr" align="center">' . "\n"; |
|
66 |
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_pass_d.gif\" alt=\"pass\" /> " . gettext("Static ARP") . "</td>\n"; |
|
63 | 67 |
} else { |
64 | 68 |
echo '<td class="listbg" align="center">' . "\n"; |
65 | 69 |
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_block.gif\" alt=\"block\" /> <font color=\"white\">" . gettext("Offline") . "</font></td>\n"; |
66 | 70 |
} |
67 | 71 |
echo '<td valign="middle" class="list nowrap">'; |
68 |
/*if($is_active) { */ |
|
69 |
/* Will always show wake-up button even if pfsense thinks it is awake */ |
|
70 |
/* } else { */ |
|
71 |
echo "<a href='services_wol.php?mac={$wolent['mac']}&if={$wolent['interface']}'> "; |
|
72 |
echo "<img title='" . gettext("Wake Up") . "' border='0' src='./themes/".$g['theme']."/images/icons/icon_wol_all.gif' alt='wol' /></a>\n"; |
|
73 |
/* } */ |
|
72 |
echo "<a href='services_wol.php?mac={$wolent['mac']}&if={$wolent['interface']}'> "; |
|
73 |
echo "<img title='" . gettext("Wake Up") . "' border='0' src='./themes/".$g['theme']."/images/icons/icon_wol_all.gif' alt='wol' /></a>\n"; |
|
74 | 74 |
echo "</td></tr>\n"; |
75 | 75 |
} |
76 | 76 |
} else { |
Also available in: Unified diff
Do not show static arp entries as Online on wol widget, based on PR #1768