From: charleswrayjr Date: Tue, 9 Sep 2025 04:31:59 +0000 (-0500) Subject: Cleaning up the revoke client function and starting on the create client function... X-Git-Url: https://git.phasecustomsoft.com/?a=commitdiff_plain;h=71ad87fa271609cc7875c7a45789e96e22caeeb6;p=phs-api.git Cleaning up the revoke client function and starting on the create client function in the vpn controller. --- diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index daedf9f..0ed06d5 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -61,8 +61,7 @@ module.exports = { `cd /etc/openvpn/easy-rsa`, `sudo ./easyrsa --batch build-client-full ${clientName} nopass`, staticIp ? `echo "ifconfig-push ${staticIp} 255.255.255.0" | tee -a /etc/openvpn/ccd/${clientName}` : 'true', - `touch /etc/openvpn/clients/${ clientName }.ovpn`, - `echo cat /etc/openvpn/client-template.txt | tee /etc/openvpn/clients/${clientName}.ovpn`, + `cp /etc/openvpn/client-template.txt /etc/openvpn/clients/${clientName}.ovpn`, `echo "" | tee -a /etc/openvpn/clients/${clientName}.ovpn`, `sudo cat pki/ca.crt | tee -a /etc/openvpn/clients/${clientName}.ovpn`, `echo "\n" | tee -a /etc/openvpn/clients/${clientName}.ovpn`,