From 5acfbcdee1fb170ddc25bb2af9306993b8d17e4d Mon Sep 17 00:00:00 2001 From: lefuturiste Date: Sun, 14 Jul 2019 13:22:18 +0000 Subject: [PATCH] fix: send ack response when shutdown and reboot --- src/overlay.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/overlay.js b/src/overlay.js index c357489..5cfd3e7 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -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") }) } }