summaryrefslogtreecommitdiff
path: root/html/maintenance.php
diff options
context:
space:
mode:
Diffstat (limited to 'html/maintenance.php')
-rw-r--r--html/maintenance.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/html/maintenance.php b/html/maintenance.php
index 338695e..c7f608f 100644
--- a/html/maintenance.php
+++ b/html/maintenance.php
@@ -66,9 +66,12 @@ if (array_key_exists('lights_out_machines', $_GET)) {
'SELECT machines.name AS machine FROM machines' .
' WHERE machines.name LIKE ' . "'" . '%-lo' . "'"
);
+ $power_id = $db -> get_state_id('power');
+ $ping_id = $db -> get_state_id('ping');
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');
+ $machine_id = $db -> get_machine_id(substr($row['machine'],0,-3));
+ $db -> add_key_for($machine_id, $power_id, 'lights-out');
+ $db -> add_key_for($machine_id, $ping_id, 'lights-out');
}
echo 'done.' . "\n";
die();