// Process .ccd files for static IPs
for (const ccdFile of ccdFiles) {
const clientName = path.basename( ccdFile, '' );
+ logger.warn( `Processing ${ ccdFile } with clientName ${ clientName }`);
try {
const ccdContent = fs.readFileSync( ccdFile, 'utf8' );
+ logger.warn( `ccdContent: ${ ccdContent }`);
const staticIpMatch = ccdContent.match( /ifconfig-push (\S+)/ );
+ logger.warn( `staticIpMatch: ${ staticIpMatch }`);
+ const hasCrt = crtFiles.some( crt => crt.includes( `${ clientName }.crt` ) );
+ logger.warn(`hasCrt: ${ hasCrt }`);
clients.push( {
clientName,
staticIp:staticIpMatch ? staticIpMatch[1] : null,
- hasCertificate:crtFiles.some( crt => crt.includes( `${ clientName }.crt` ) ),
+ hasCertificate:hasCrt,
} );
} catch (error) {
logger.warn( `Failed to read ${ ccdFile }: ${ error.message }` );