ssh-agent/cleanup.js

11 lines
359 B
JavaScript

const { execFileSync } = require('child_process');
const { sshAgentCmd } = require('./paths.js');
try {
// Kill the started SSH agent
console.log('Stopping SSH agent');
execFileSync(sshAgentCmd, ['-k'], { stdio: 'inherit' });
} catch (error) {
console.log(error.message);
console.log('Error stopping the SSH agent, proceeding anyway');
}