From: charleswrayjr Date: Mon, 8 Sep 2025 04:01:27 +0000 (-0500) Subject: Testing vpn paths. X-Git-Url: https://git.phasecustomsoft.com/stylesheets/static/git-favicon.png?a=commitdiff_plain;h=48f1321e99bed40c3c9092e7990a16b50815f9e2;p=phs-api.git Testing vpn paths. --- diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index 395ae58..7ec5747 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -75,7 +75,7 @@ module.exports = { }, getClients:async ( req, res, next ) => { const conn = new Client(); conn.on( 'ready', () => { - const command = `cat /var/log/openvpn/openvpn-status.log | grep "OpenVPN CLIENT LIST`; + const command = `cat /var/log/openvpn/openvpn-status.log`; conn.exec( command, ( err, stream ) => { if (err) { conn.end(); @@ -87,7 +87,7 @@ module.exports = { stream.on( 'close', ( code ) => { conn.end(); if (code === 0) { - const clients = output.split( '\n' ).filter( line => line.includes( 'CLIENT_LIST' ) ).map( line => { + const clients = output.split( '\n' ).filter( line => line.startsWith( 'Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since' ) ).map( line => { const parts = line.split( ',' ); return { name:parts[1], ip:parts[2], connectedSince:parts[8] }; } );