summaryrefslogtreecommitdiffstats
path: root/server/api/configloader.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-10-11 23:02:32 +0200
committerJannik Schönartz2018-10-11 23:02:32 +0200
commitb2a6274c13a49a5d1e9362850df2cc32b1b7a183 (patch)
treecf25c5ff097c8acb9fc2ae5456db08fac95f0189 /server/api/configloader.js
parent[configloader] add missing line to make the dynamic menu selectable (diff)
downloadbas-b2a6274c13a49a5d1e9362850df2cc32b1b7a183.tar.gz
bas-b2a6274c13a49a5d1e9362850df2cc32b1b7a183.tar.xz
bas-b2a6274c13a49a5d1e9362850df2cc32b1b7a183.zip
[registration] Set registration state when client is added
[configloader] Add functionality to boot the ipxe script or minilinux. Add ipxe script, which boots the minilinux. Add script to grep the hw data with dmidecode
Diffstat (limited to 'server/api/configloader.js')
-rw-r--r--server/api/configloader.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/api/configloader.js b/server/api/configloader.js
index 4a6f58e..dab2bd8 100644
--- a/server/api/configloader.js
+++ b/server/api/configloader.js
@@ -11,6 +11,15 @@ noAuthRouter.get('/:uuid', (req, res) => {
db.client.findOne({ where: { uuid: uuid }, include: ['groups'] }).then(client => {
if (client !== null) {
+ // Check for registration hooks.
+ if (client.registrationState !== null) {
+ 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'))
+ })
+ return
+ }
+
// client is in db
if (client.configId !== null) {
// client has a config