summaryrefslogtreecommitdiffstats
path: root/inc/trigger.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-20 16:40:25 +0200
committerSimon Rettberg2021-04-20 16:40:25 +0200
commit7c5748d3a6bc12ece61ccf782047f6200b79b325 (patch)
treed409550975adb7e014dd919892d4e110e55f62c4 /inc/trigger.inc.php
parent[sysconfig] Enforce proper ldadp services running on reboot/install (diff)
downloadslx-admin-7c5748d3a6bc12ece61ccf782047f6200b79b325.tar.gz
slx-admin-7c5748d3a6bc12ece61ccf782047f6200b79b325.tar.xz
slx-admin-7c5748d3a6bc12ece61ccf782047f6200b79b325.zip
[serversetup-bwlp-ipxe] Add iPXE version selector
Diffstat (limited to 'inc/trigger.inc.php')
-rw-r--r--inc/trigger.inc.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php
index 5024b907..cd38ce98 100644
--- a/inc/trigger.inc.php
+++ b/inc/trigger.inc.php
@@ -14,20 +14,18 @@ class Trigger
/**
* Compile iPXE pxelinux menu. Needs to be done whenever the server's IP
* address changes.
- *
- * @param boolean $force force recompilation even if it seems up to date
- * @return boolean|string false if launching task failed, task-id otherwise
+ *
+ * @return string|false false if launching task failed, task-id otherwise
*/
- public static function ipxe()
+ public static function ipxe($taskId = null)
{
$hooks = Hook::load('ipxe-update');
- static $taskId = false;
foreach ($hooks as $hook) {
$ret = function($taskId) use ($hook) {
$ret = include_once($hook->file);
if (is_string($ret))
return $ret;
- return isset($taskId) ? $taskId : false;
+ return $taskId;
};
$ret = $ret($taskId);
if (is_string($ret)) {
@@ -36,8 +34,7 @@ class Trigger
$taskId = $ret['id'];
}
}
- Property::set('ipxe-task-id', $taskId, 15);
- return $taskId;
+ return $taskId ?? false;
}
/**