API Call for triggering Device discovery (#10861)

This commit is contained in:
SourceDoctor
2019-12-08 22:17:27 +01:00
committed by PipoCanaja
parent f4ec978c08
commit 4232bf2f36
4 changed files with 67 additions and 0 deletions

View File

@@ -434,6 +434,24 @@ function renamehost($id, $new, $source = 'console')
return "Renaming of $host failed\n";
}
function device_discovery_trigger($id)
{
global $debug;
if (isCli() === false) {
ignore_user_abort(true);
set_time_limit(0);
}
$update = dbUpdate(array('last_discovered' => array('NULL')), 'devices', '`device_id` = ?', array($id));
if (!empty($update) || $update == '0') {
$message = 'Device will be rediscovered';
} else {
$message = 'Error rediscovering device';
}
return array('status'=> $update, 'message' => $message);
}
function delete_device($id)
{
global $debug;