summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol/inc/rebootcontrol.inc.php')
-rw-r--r--modules-available/rebootcontrol/inc/rebootcontrol.inc.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
index 680f9eff..8a85e3ff 100644
--- a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
+++ b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php
@@ -123,13 +123,17 @@ class RebootControl
if ($privkey === false) {
$privkey = SSHKey::getPrivateKey();
}
- return Taskmanager::submit('RemoteExec', [
+ $task = Taskmanager::submit('RemoteExec', [
'clients' => $valid,
'command' => $command,
'timeoutSeconds' => $timeout,
'sshkey' => $privkey,
'port' => 9922, // Fallback if no port given in client struct
]);
+ if (!Taskmanager::isFailed($task)) {
+ Property::addToList(RebootControl::KEY_TASKLIST, '0/' . $task["id"], 60 * 24);
+ }
+ return $task;
}
public static function connectionCheckCallback($task, $hostId)