diff --git a/index.js b/index.js index 07c0d2c..7070ed5 100644 --- a/index.js +++ b/index.js @@ -348,14 +348,20 @@ function rUpdate (req, res, next) { exec('sh ./scripts/update.sh', (err, stdio, stderr) => { res.send({ success : true, action : 'update' }) res.end() - process.exit(0) + next() + setTimeout(() => { + process.exit(0) + }, 100) }) } function rRestart (req, res, next) { res.send({ success : true, action : 'restart' }) res.end() - process.exit(0) + next() + setTimeout(() => { + process.exit(0) + }, 100) } //Ble functions