diff options
Diffstat (limited to 'html')
-rw-r--r-- | html/maintenance.php | 16 |
1 files changed, 15 insertions, 1 deletions
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()) { ?> <h1>Global Tasks</h1> -<a href="?ddns">ddns</a><br> <a href="?ddns_machines">initialize machines from ddns tokens</a><br> +<a href="?ddns">ddns</a><br> +<a href="?lights_out_machines">initialize keys for lights-out machines</a><br> <h1>Danger zone</h1> <a href="?drop=DROP">drop</a><br> </body></html> |