summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-21 17:02:04 +0100
committerSimon Rettberg2013-11-21 17:02:04 +0100
commit639715cee0744fd1b5f5ded28b1b60c969702026 (patch)
tree6680655fc15c354ed34dcbe09bc179969644d3f2 /apis
parentNotify about missing options/files/actions on dashboard (diff)
downloadslx-admin-639715cee0744fd1b5f5ded28b1b60c969702026.tar.gz
slx-admin-639715cee0744fd1b5f5ded28b1b60c969702026.tar.xz
slx-admin-639715cee0744fd1b5f5ded28b1b60c969702026.zip
Make default boot entry selectable (also fix menu timeout)
Diffstat (limited to 'apis')
-rw-r--r--apis/exec.inc.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apis/exec.inc.php b/apis/exec.inc.php
index 749ca86a..60ca679f 100644
--- a/apis/exec.inc.php
+++ b/apis/exec.inc.php
@@ -47,6 +47,8 @@ switch ($type) {
case 'ipxe':
if (!isset($_REQUEST['ip'])) die('No IP given');
$ip = preg_replace('/[^0-9\.]/', '', $_REQUEST['ip']);
+ $default = $_REQUEST['default'];
+ if (!preg_match('/openslx|hddboot/', $default)) $default = 'openslx';
$command = '/opt/openslx/build_ipxe.sh "' . CONFIG_IPXE_DIR . '/last-ip" "' . $ip . '"';
$conf = Render::parse('txt-ipxeconfig', array(
'SERVER' => $ip
@@ -54,7 +56,8 @@ case 'ipxe':
if (false === file_put_contents('/opt/openslx/ipxe/ipxelinux.ipxe', $conf)) die('Error writing iPXE Config');
$conf = Render::parse('txt-pxeconfig', array(
'SERVER' => $ip,
- 'DEFAULT' => 'openslx'
+ 'DEFAULT' => $default,
+ $default => 'MENU DEFAULT'
));
if (false === file_put_contents(CONFIG_TFTP_DIR . '/pxelinux.cfg/default', $conf)) die('Error writing PXE Menu');
Database::exec("INSERT IGNORE INTO setting_global (setting, value) VALUES ('SLX_VM_NFS', :value)", array(':value' => "$ip:/srv/openslx/nfs"));