diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /inc/trigger.inc.php | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.gz slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.xz slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'inc/trigger.inc.php')
-rw-r--r-- | inc/trigger.inc.php | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index 2af73872..e89a9a17 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -20,12 +20,24 @@ class Trigger */ public static function ipxe() { - $data = Property::getBootMenu(); - $data['ipaddress'] = Property::getServerIp(); - $task = Taskmanager::submit('CompileIPxe', $data); - if (!isset($task['id'])) - return false; - return $task['id']; + $hooks = Hook::load('ipxe-update'); + $taskId = false; + foreach ($hooks as $hook) { + $ret = function($taskId) use ($hook) { + $ret = include_once($hook->file); + if (is_string($ret)) + return $ret; + return isset($taskId) ? $taskId : false; + }; + $ret = $ret($taskId); + if (is_string($ret)) { + $taskId = $ret; + } elseif (is_array($ret) && isset($ret['id'])) { + $taskId = $ret['id']; + } + } + Property::set('ipxe-task-id', $taskId, 15); + return $taskId; } /** @@ -127,14 +139,23 @@ class Trigger } if ($storetype === 'nfs') { $addr = $vmstore['nfsaddr']; + $opts = 'nfsopts'; } elseif ($storetype === 'cifs') { $addr = $vmstore['cifsaddr']; + $opts = 'cifsopts'; } else { + $opts = null; $addr = 'null'; } + if (isset($vmstore[$opts])) { + $opts = $vmstore[$opts]; + }else { + $opts = null; + } return Taskmanager::submit('MountVmStore', array( 'address' => $addr, 'type' => 'images', + 'opts' => $opts, 'username' => $vmstore['cifsuser'], 'password' => $vmstore['cifspasswd'] )); |