31 lines
691 B
PHP
31 lines
691 B
PHP
|
<?php
|
||
|
|
||
|
header("Content-Type: text/plain");
|
||
|
|
||
|
$config = json_decode(file_get_contents("/config/config.json"), true);
|
||
|
|
||
|
$menuOptions = "";
|
||
|
$gotoSections = "";
|
||
|
foreach($config["iscsi-targets"] as $target) {
|
||
|
$id = uniqid();
|
||
|
$menuOptions .= "item {$id} {$target['name']}\r\n";
|
||
|
$gotoSections .= ":{$id}\r\n";
|
||
|
$gotoSections .= "sanboot {$target['target']}\r\n";
|
||
|
$gotoSections .= "goto back\r\n";
|
||
|
};
|
||
|
|
||
|
$template = "#!ipxe
|
||
|
menu Select an iSCSI target to boot from
|
||
|
item --gap -- iSCSI targets
|
||
|
{$menuOptions}
|
||
|
item
|
||
|
item back Back to main menu
|
||
|
choose selected
|
||
|
goto \${selected} || goto shell
|
||
|
|
||
|
{$gotoSections}
|
||
|
|
||
|
:back
|
||
|
chain http://{$config['host']}/ipxe/main-menu.php";
|
||
|
|
||
|
print($template);
|