diff options
author | Simon Rettberg | 2020-09-03 12:06:07 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-09-03 12:06:07 +0200 |
commit | 5574e028dc0ed802d4954b577151cc09c9687ee5 (patch) | |
tree | 5c5e5d49740aa0ee8f80ad664f2408d89eecc65b /modules-available/rebootcontrol/inc | |
parent | [serversetup-bwlp-ipxe/rebootcontrol] Fix translations (diff) | |
download | slx-admin-5574e028dc0ed802d4954b577151cc09c9687ee5.tar.gz slx-admin-5574e028dc0ed802d4954b577151cc09c9687ee5.tar.xz slx-admin-5574e028dc0ed802d4954b577151cc09c9687ee5.zip |
[rebootcontrol] WOL: Make UDP-Port and c2c discovery configurable
The port setting only applies to WOL-packets sent from the satellite
server.
Testing the reachability of client subnets between each other is usually
pointless, since a subnet that is reachable from another subnet can also
be reached form the satelitte server, unless some fancy firewall rules
are in place.
Diffstat (limited to 'modules-available/rebootcontrol/inc')
-rw-r--r-- | modules-available/rebootcontrol/inc/rebootcontrol.inc.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php index bb3bcd0c..a8018004 100644 --- a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php +++ b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php @@ -7,6 +7,10 @@ class RebootControl const KEY_AUTOSCAN_DISABLED = 'rebootcontrol.disable.scan'; + const KEY_SCAN_CLIENT_TO_CLIENT = 'rebootcontrol.scan.c2c'; + + const KEY_UDP_PORT = 'rebootcontrol.port'; + const REBOOT = 'REBOOT'; const KEXEC_REBOOT = 'KEXEC_REBOOT'; const SHUTDOWN = 'SHUTDOWN'; @@ -240,10 +244,15 @@ class RebootControl if (!is_array($macaddr)) { $macaddr = [$macaddr]; } + $port = (int)Property::get(RebootControl::KEY_UDP_PORT); + if ($port < 1 || $port > 65535) { + $port = 9; + } return Taskmanager::submit('WakeOnLan', [ 'ip' => $bcast, 'password' => $passwd === false ? '' : $passwd, 'macs' => $macaddr, + 'port' => $port, ]); } |