From 4751361da592721b6e1fbdae884381c3ac3d8ee8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 9 Dec 2005 20:32:54 +0000 Subject: Correctly wake all clients --- usr/local/www/services_wol.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php index cd07ab0..9db5aa6 100755 --- a/usr/local/www/services_wol.php +++ b/usr/local/www/services_wol.php @@ -38,6 +38,19 @@ if (!is_array($config['wol']['wolentry'])) { wol_sort(); $a_wol = &$config['wol']['wolentry']; +if($_GET['wakeall'] <> "") { + $i = 0; + $savemsg = ""; + foreach ($a_wol as $wolent) { + $mac = $wolent['mac']; + $if = $wolent['interface']; + $bcip = gen_subnet_max($config['interfaces'][$if]['ipaddr'], + $config['interfaces'][$if]['subnet']); + mwexec("/usr/local/bin/wol -i {$bcip} {$mac}"); + $savemsg .= "Sent magic packet to {$mac}.
"; + } +} + if ($_POST || $_GET['mac']) { unset($input_errors); @@ -59,19 +72,6 @@ if ($_POST || $_GET['mac']) { if (!$if) $input_errors[] = "A valid interface must be specified."; - if($_GET['wakeall'] <> "") { - $i = 0; - $savemsg = ""; - foreach ($a_wol as $wolent) { - $mac = $wolent['mac']; - $if = $wolent['interface']; - $bcip = gen_subnet_max($config['interfaces'][$if]['ipaddr'], - $config['interfaces'][$if]['subnet']); - mwexec("/usr/local/bin/wol -i {$bcip} {$mac}"); - $savemsg .= "Sent magic packet to {$mac}.
"; - } - } - if (!$input_errors) { /* determine broadcast address */ $bcip = gen_subnet_max($config['interfaces'][$if]['ipaddr'], -- cgit v1.1