summaryrefslogtreecommitdiffstats
path: root/server/lib/shell.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-07-17 04:43:31 +0200
committerJannik Schönartz2018-07-17 04:43:31 +0200
commite4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3 (patch)
tree0c40021f77fea9688449c9c4d6e6222a809ec3d6 /server/lib/shell.js
parent[webapp] renamed components (diff)
downloadbas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.gz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.xz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.zip
[server] Fixed eslint errors. (Standard ESLint is used)
Diffstat (limited to 'server/lib/shell.js')
-rw-r--r--server/lib/shell.js64
1 files changed, 32 insertions, 32 deletions
diff --git a/server/lib/shell.js b/server/lib/shell.js
index 931286c..311af1d 100644
--- a/server/lib/shell.js
+++ b/server/lib/shell.js
@@ -1,38 +1,38 @@
/* global __appdir */
-var path = require('path');
-var shell = require('shelljs');
-var ipxeGIT = 'git://git.ipxe.org/ipxe.git';
+var path = require('path')
+var shell = require('shelljs')
+var ipxeGIT = 'git://git.ipxe.org/ipxe.git'
module.exports = {
- buildIPXE: function(req, res) {
- if (!shell.which('git')) {
- return res.status(500).send({ status: 'GIT_MISSING', error_message: 'Please install git on the server.' });
- }
-
- var gitclone = 'git clone ' + ipxeGIT;
- shell.cd(path.join(__appdir, 'ipxe'));
- shell.exec(gitclone, function(code, stdout, stderr) {
- shell.cd(path.join(__appdir, 'ipxe', 'ipxe', 'src'));
-
- // Remove the general config and paste in the own one
- shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'general.h'));
- shell.cp(path.join(__appdir, 'ipxe', 'general.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
- shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'console.h'));
- shell.cp(path.join(__appdir, 'ipxe', 'console.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
- //var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
- var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe') + " TRUST=" + path.join(__appdir, 'bin', 'fullchain.pem');
- //shell.env.PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin';
- shell.env.DEBUG = '';
- shell.exec(make, function(code, stdout, stderr) {
- shell.rm(path.join(__appdir, 'tftp', 'ipxe.0'));
- shell.cp('bin/ipxe.pxe', path.join(__appdir, 'tftp'));
- shell.mv(path.join(__appdir, 'tftp', 'ipxe.pxe'), path.join(__appdir, 'tftp', 'ipxe.0'));
- // shell.rm('-rf', 'ipxe');
- return res.status(200).send({ status: 'success' });
- });
- });
+ buildIPXE: function (req, res) {
+ if (!shell.which('git')) {
+ return res.status(500).send({ status: 'GIT_MISSING', error_message: 'Please install git on the server.' })
}
-};
+
+ var gitclone = 'git clone ' + ipxeGIT
+ shell.cd(path.join(__appdir, 'ipxe'))
+ shell.exec(gitclone, function (code, stdout, stderr) {
+ shell.cd(path.join(__appdir, 'ipxe', 'ipxe', 'src'))
+
+ // Remove the general config and paste in the own one
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'general.h'))
+ shell.cp(path.join(__appdir, 'ipxe', 'general.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'))
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'console.h'))
+ shell.cp(path.join(__appdir, 'ipxe', 'console.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'))
+ // var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
+ var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe') + ' TRUST=' + path.join(__appdir, 'bin', 'fullchain.pem')
+ // shell.env.PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin';
+ shell.env.DEBUG = ''
+ shell.exec(make, function (code, stdout, stderr) {
+ shell.rm(path.join(__appdir, 'tftp', 'ipxe.0'))
+ shell.cp('bin/ipxe.pxe', path.join(__appdir, 'tftp'))
+ shell.mv(path.join(__appdir, 'tftp', 'ipxe.pxe'), path.join(__appdir, 'tftp', 'ipxe.0'))
+ // shell.rm('-rf', 'ipxe');
+ return res.status(200).send({ status: 'success' })
+ })
+ })
+ }
+}
// sudo apt-get install liblzma-dev
-// sudo apt-get install mkisofs \ No newline at end of file
+// sudo apt-get install mkisofs