diff options
author | Simon Rettberg | 2020-07-10 16:40:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-07-10 16:40:06 +0200 |
commit | 8cdccaeb71a167c6a16b715e65967da3be8a040a (patch) | |
tree | b8239c2a701b7d05b75a5a19f93f93ffc03e4f7e /modules-available/serversetup-bwlp-ipxe/api.inc.php | |
parent | [minilinux] Lower update disable to 5 mins (was 10) (diff) | |
download | slx-admin-8cdccaeb71a167c6a16b715e65967da3be8a040a.tar.gz slx-admin-8cdccaeb71a167c6a16b715e65967da3be8a040a.tar.xz slx-admin-8cdccaeb71a167c6a16b715e65967da3be8a040a.zip |
[serversetup-bwlp-ipxe] Progress on new structure (+bash)
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/api.inc.php')
-rw-r--r-- | modules-available/serversetup-bwlp-ipxe/api.inc.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/api.inc.php b/modules-available/serversetup-bwlp-ipxe/api.inc.php index 303f1560..dd559efa 100644 --- a/modules-available/serversetup-bwlp-ipxe/api.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/api.inc.php @@ -1,12 +1,26 @@ <?php (function() { - $builder = new ScriptBuilderIpxe(); + $type = Request::any('type'); + if ($type === 'bash') { + $builder = new ScriptBuilderBash(); + } else { + $builder = new ScriptBuilderIpxe(); + } + $bootEntryId = Request::get('beid', false, 'string'); $entryId = Request::get('entryid', false, 'int'); - if ($entryId !== false) { - $data = $builder->getMenuEntry($entryId); + if ($bootEntryId !== false) { + $entry = BootEntry::fromDatabaseId($bootEntryId); + $data = $builder->getBootEntry($entry); + } elseif ($entryId !== false) { + $entry = MenuEntry::get($entryId); + $data = $builder->getMenuEntry($entry); } else { - $data = $builder->fallback(); + $data = $builder->bootstrapLive(); + if ($data === false) { + $menu = IPxeMenu::forClient($builder->clientIp(), $builder->uuid()); + $data = $builder->getMenu($menu, true); + } } $builder->output($data); })(); |