`cat /etc/openvpn/clients/${clientName}.ovpn`,
];
- console.log( commands );
- console.log( [...commands].join( ' && ' ) );
conn.exec( commands.join( ' && ' ), ( err, stream ) => {
if (err) {
conn.end();
const conn = new Client();
conn.on( 'ready', () => {
- logger.warn('ready')
const commands = [
`cd /etc/openvpn/easy-rsa`,
`./easyrsa --batch revoke ${ clientName }`,
`rm -f /etc/openvpn/ccd/${ clientName }`,
`sudo systemctl restart openvpn@server`,];
- logger.warn( commands );
- logger.warn( [...commands].join( ' && ' ) );
-
conn.exec( commands.join( ' && ' ), ( err, stream ) => {
if (err) {
conn.end();
conn.end();
if (code === 0) {
const clients = parseVpnStatus( output );
- console.log( clients );
res.json( { clients } );
} else {
const error = new createError( 500, `Command failed: ${ output }` );