End response and call next() before restarting process.
This commit is contained in:
parent
64343bfc0b
commit
9c0ca37481
10
index.js
10
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
|
||||
|
|
Loading…
Reference in New Issue