blob: 7575ad55272a8e1b7e10142b3e24fff59759d116 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
(function() {
$type = Request::any('type');
if ($type === 'bash') {
$builder = new ScriptBuilderBash();
} else {
$builder = new ScriptBuilderIpxe();
}
$bootEntryId = Request::get('beid', false, 'string');
if ($bootEntryId !== false) {
$bootEntryId = Util::cleanUtf8($bootEntryId);
}
$entryId = Request::get('entryid', false, 'int');
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->bootstrapLive();
if ($data === false) {
$menu = IPxeMenu::forClient($builder->clientIp(), $builder->uuid());
$data = $builder->getMenu($menu, true);
}
}
$builder->output($data);
})();
|