summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/hooks/cron.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol/hooks/cron.inc.php')
-rw-r--r--modules-available/rebootcontrol/hooks/cron.inc.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/rebootcontrol/hooks/cron.inc.php b/modules-available/rebootcontrol/hooks/cron.inc.php
index 56446c49..c1136c98 100644
--- a/modules-available/rebootcontrol/hooks/cron.inc.php
+++ b/modules-available/rebootcontrol/hooks/cron.inc.php
@@ -27,12 +27,14 @@ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
$machines = Database::queryAll("SELECT machineuuid, clientip, macaddr, locationid FROM machine
WHERE locationid = :locid", ['locid' => $row['locationid']]);
- if ($row['action'] === 'sd') {
+ if ($row['action'] === Scheduler::SHUTDOWN) {
RebootControl::execute($machines, RebootControl::SHUTDOWN, 0);
- } elseif ($row['action'] === 'wol') {
+ } elseif ($row['action'] === Scheduler::WOL) {
RebootControl::wakeMachines($machines);
- } elseif ($row['action'] === 'rb') {
+ } elseif ($row['action'] === Scheduler::REBOOT) {
RebootControl::execute($machines, RebootControl::REBOOT, 0);
+ } else {
+ EventLog::warning("Invalid action '{$row['action']}' in schedule for location " . $row['locationid']);
}
}