exit 0 unless ($DEPTH eq "0");
# Strip the CN from the X509 identifier.
-$CN =~ /\/CN=(.*)$/i;
-$CN = $1;
+$CN =~ /(\/|,\ )CN=(.*)$/i;
+$CN = $2;
my %confighash = ();
if (-f "${General::swroot}/ovpn/ovpnconfig"){
exit 0 if ($cn eq $CN);
# Compatibility code for incorrectly saved CNs.
- $cn =~ s/\ /_/;
+ $cn =~ s/\ /_/g;
exit 0 if ($cn eq $CN);
}
}