Skip to content

Commit

Permalink
fix: send ack response when shutdown and reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
lefuturiste committed Jul 14, 2019
1 parent ce03eff commit 5acfbcd
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,19 @@ module.exports = class Overlay {
})
}
shutdown () {
return new Promise((resolve, reject) => {
childProcess.exec("poweroff", (err, stdout, stderr) => {
if (err || stderr != '') return reject()

return resolve({ack: true})
return new Promise(resolve => {
resolve({
ack: true
})
childProcess.exec("poweroff")
})
}
reboot () {
return new Promise((resolve, reject) => {
childProcess.exec("reboot", (err, stdout, stderr) => {
if (err || stderr != '') return reject()

return resolve({
ack: true
})
return new Promise(resolve => {
resolve({
ack: true
})
childProcess.exec("reboot")
})
}
}

0 comments on commit 5acfbcd

Please sign in to comment.