From b68c32227484822f4d213683ef5602328bc17449 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 28 Jul 2022 11:08:39 +0200 Subject: lights_out_machines new --- html/maintenance.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/html/maintenance.php b/html/maintenance.php index 23cd167..338695e 100644 --- a/html/maintenance.php +++ b/html/maintenance.php @@ -61,6 +61,19 @@ if (array_key_exists('ddns_machines', $_GET)) { die(); } +if (array_key_exists('lights_out_machines', $_GET)) { + $result = $db -> query( + 'SELECT machines.name AS machine FROM machines' . + ' WHERE machines.name LIKE ' . "'" . '%-lo' . "'" + ); + while ($row = $result -> fetchArray()) { + $db -> add_key_for(substr($row['machine'],0,-3), 'power', 'lights-out'); + $db -> add_key_for(substr($row['machine'],0,-3), 'ping', 'lights-out'); + } + echo 'done.' . "\n"; + die(); +} + if (array_key_exists('ddns', $_GET)) { $result = $db -> query( 'SELECT keys.id FROM keys' . @@ -114,8 +127,9 @@ while ($row = $result -> fetchArray()) { ?>

Global Tasks

-ddns
initialize machines from ddns tokens
+ddns
+initialize keys for lights-out machines

Danger zone

drop
-- cgit v1.2.3-54-g00ecf