diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php
index 389047aa9f..8fe4ad7853 100755
--- a/usr/local/www/services_wol.php
+++ b/usr/local/www/services_wol.php
@@ -50,10 +50,16 @@ if($_GET['wakeall'] <> "") {
foreach ($a_wol as $wolent) {
$mac = $wolent['mac'];
$if = $wolent['interface'];
+ $description = $wolent['descr'];
$bcip = gen_subnet_max(get_interface_ip($if),
get_interface_subnet($if));
- mwexec("/usr/local/bin/wol -i {$bcip} {$mac}");
- $savemsg .= "Sent magic packet to {$mac}.
";
+ /* Execute wol command and check return code. */
+ if(!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}")){
+ $savemsg .= "Sent magic packet to {$mac} ({$description}).
";
+ }
+ else {
+ $savemsg .= "Please check the system log, the wol command for {$description} ({$mac}) did not complete successfully.
";
+ }
}
}
@@ -82,9 +88,13 @@ if ($_POST || $_GET['mac']) {
/* determine broadcast address */
$bcip = gen_subnet_max(get_interface_ip($if),
get_interface_subnet($if));
-
- mwexec("/usr/local/bin/wol -i {$bcip} {$mac}");
- $savemsg = "Sent magic packet to {$mac}.";
+ /* Execute wol command and check return code. */
+ if(!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}")){
+ $savemsg .= "Sent magic packet to {$mac}.";
+ }
+ else {
+ $savemsg .= "Please check the system log, the wol command for {$mac} did not complete successfully.
";
+ }
}
}