shell: add explicit bash() function
This commit is contained in:
@@ -34,7 +34,7 @@ async function ensureKeys() {
|
||||
debug(`ensureSecrets: generating new sftp keys of type ${keyType}`);
|
||||
safe.fs.unlinkSync(publicKeyFile);
|
||||
safe.fs.unlinkSync(privateKeyFile);
|
||||
const [error] = await safe(shell.exec(`ssh-keygen -m PEM -t ${keyType} -f ${paths.SFTP_KEYS_DIR}/ssh_host_${keyType}_key -q -N ""`, { shell: '/bin/bash' }));
|
||||
const [error] = await safe(shell.spawn('ssh-keygen', ['-m', 'PEM', '-t', keyType, '-f', `${paths.SFTP_KEYS_DIR}/ssh_host_${keyType}_key`, '-q', '-N', ''], {}));
|
||||
if (error) throw new BoxError(BoxError.OPENSSL_ERROR, `Could not generate sftp ${keyType} keys: ${error.message}`);
|
||||
const newPublicKey = safe.fs.readFileSync(publicKeyFile);
|
||||
await blobs.set(`sftp_${keyType}_public_key`, newPublicKey);
|
||||
@@ -124,7 +124,7 @@ async function start(existingInfra) {
|
||||
await docker.deleteContainer('sftp');
|
||||
|
||||
debug('startSftp: starting sftp container');
|
||||
await shell.exec(runCmd, { shell: '/bin/bash' });
|
||||
await shell.bash(runCmd, {});
|
||||
}
|
||||
|
||||
async function status() {
|
||||
|
||||
Reference in New Issue
Block a user