]> PHS Git Server - phs-api.git/commitdiff
Adding disconnect, getStatus, and restart to the vpn.controller.js and associated...
authorcharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 18:48:06 +0000 (13:48 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 18:48:06 +0000 (13:48 -0500)
src/controllers/vpn.controller.js

index 891b400c2d94af5849f01c720c0e8a390dab84e9..c1338310ead590fc6b54aa3380fdf39e56252354 100644 (file)
@@ -326,12 +326,15 @@ module.exports = {
             conn.end();
             return next( new createError( 500, `SSH command failed: ${ err.message }` ) );
           }
-          console.log(stream.data);
+          logger.warn(stream);
           let output = '';
           stream.on( 'data', ( data ) => (output += data) );
           stream.stderr.on( 'data', ( data ) => (output += data) );
           stream.on( 'close', ( code ) => {
             conn.end();
+            logger.warn(code);
+            logger.warn( output );
+            logger.warn( output.trim() === 'active' );
             if (code === 0) {
               res.json( { active:output.trim() === 'active' } );
             } else {