shell: make shell.sudo promise based and waitable
This commit is contained in:
@@ -174,7 +174,7 @@ async function validateCertificate(subdomain, domain, certificate) {
|
||||
|
||||
async function notifyCertChange() {
|
||||
await mailServer.checkCertificate();
|
||||
await shell.promises.sudo([ RESTART_SERVICE_CMD, 'box' ], {}); // directory server
|
||||
await shell.sudo([ RESTART_SERVICE_CMD, 'box' ], {}); // directory server
|
||||
const allApps = (await apps.list()).filter(app => app.runState !== apps.RSTATE_STOPPED);
|
||||
for (const app of allApps) {
|
||||
if (app.manifest.addons?.tls) await setupTlsAddon(app);
|
||||
@@ -184,7 +184,7 @@ async function notifyCertChange() {
|
||||
async function reload() {
|
||||
if (constants.TEST) return;
|
||||
|
||||
const [error] = await safe(shell.promises.sudo([ RESTART_SERVICE_CMD, 'nginx' ], {}));
|
||||
const [error] = await safe(shell.sudo([ RESTART_SERVICE_CMD, 'nginx' ], {}));
|
||||
if (error) throw new BoxError(BoxError.NGINX_ERROR, `Error reloading nginx: ${error.message}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user