summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/hooks/ipxe-update.inc.php
blob: 76f8cfa2bbba4385e0f5a55acbbd08c114534a39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

$get = Module::get('serversetup');
if ($get === false)
	return;

$get->activate(1, false);

$data = [
	'ipaddress' => Property::getServerIp(),
	'parentTask' => $taskId,
];
if ($data['ipaddress'] === 'invalid')
	return null;
$task = Taskmanager::submit('CompileIPxeNew', $data);
if (Taskmanager::isFailed($task)) {
	error_log(print_r($task, true));
	return null;
}
TaskmanagerCallback::addCallback($task, 'ipxeCompileDone');
Property::set(IPxeBuilder::PROP_IPXE_COMPILE_TASKID, $task['id'], 15);
return $task['id'];