End response and call next() before restarting process.

This commit is contained in:
mmcwilliams 2018-02-08 15:50:21 -05:00
parent 64343bfc0b
commit 9c0ca37481
1 changed files with 8 additions and 2 deletions

View File

@ -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()
next()
setTimeout(() => {
process.exit(0)
}, 100)
})
}
function rRestart (req, res, next) {
res.send({ success : true, action : 'restart' })
res.end()
next()
setTimeout(() => {
process.exit(0)
}, 100)
}
//Ble functions