summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/api.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/api.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/api.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/api.inc.php b/modules-available/serversetup-bwlp-ipxe/api.inc.php
index 0d59ea1d..67da6727 100644
--- a/modules-available/serversetup-bwlp-ipxe/api.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/api.inc.php
@@ -76,7 +76,12 @@ if ($menu !== false) {
$menu = IPxeMenu::forClient($ip, $uuid);
$initLabel = 'init';
}
-
+// If this is a menu with a single item, treat a timeout of 0 as "boot immediately" instead of "infinite"
+if ($menu->itemCount() === 1 && $menu->timeoutMs() === 0 && ($tmp = $menu->getDefaultScriptLabel()) !== false) {
+ $directBoot = "goto $tmp ||";
+} else {
+ $directBoot = '';
+}
// Get preferred localboot method, depending on system model
$localboot = false;
@@ -177,6 +182,8 @@ set serverip $serverIp ||
# Clean up in case we've been chained to
imgfree ||
+$directBoot
+
imgfetch --name bg-menu /tftp/pxe-menu.png ||
:start