conn.on( 'ready', () => {
const commands = [`cd /etc/openvpn/easy-rsa`, `./easyrsa revoke ${ clientName }`, `./easyrsa gen-crl`, `cp pki/crl.pem /etc/openvpn/crl.pem`, `rm -f /etc/openvpn/client-configs/${ clientName }.ccd`, `systemctl restart openvpn@server`,];
+ console.log( commands );
+ console.log( [...commands].join( ' && ' ) );
+
conn.exec( commands.join( ' && ' ), ( err, stream ) => {
if (err) {
conn.end();
}, getClients:async ( req, res, next ) => {
const conn = new Client();
conn.on( 'ready', () => {
- const command = `cat /etc/openvpn/server/status`;
+ const command = `cat /etc/openvpn/openvpn-status`;
conn.exec( command, ( err, stream ) => {
if (err) {
conn.end();