summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/api/configloader.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/api/configloader.js b/server/api/configloader.js
index dab2bd8..7b89501 100644
--- a/server/api/configloader.js
+++ b/server/api/configloader.js
@@ -13,6 +13,7 @@ noAuthRouter.get('/:uuid', (req, res) => {
if (client !== null) {
// Check for registration hooks.
if (client.registrationState !== null) {
+ // client is in registration state, load scripts
db.registrationhook.findOne({ where: { id: client.registrationState } }).then(hook => {
if (hook.type === 'IPXE') res.send(hook.script)
else if (hook.type === 'BASH') res.sendFile(path.join(__appdir, 'ipxe', 'minilinux.ipxe'))
@@ -94,7 +95,7 @@ function checkGroupsForConfigs (groupIds) {
configIds.push(group.configId)
}
})
- if (configIds.length !== 0) {
+ if (configIds.length !== 0 || parentIds.length === 0) {
return configIds
} else {
return checkGroupsForConfigs(parentIds).then(response => {