OpenVPN CCD: Fix ccd filename when certificate has spaces in name. Now the filename gets an underscore to provide full functionality of openvpn.

This commit is contained in:
Alexander Marx
2013-01-07 08:46:42 +01:00
committed by Michael Tremer
parent 1d109fd2a6
commit b643120c01
2 changed files with 2 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ open(FILE,"/var/ipfire/ovpn/server.conf");
&General::readhasharray("/var/ipfire/ovpn/ovpnconfig", \%ovpnconfig);
foreach my $key (keys %ovpnconfig){
if($ovpnconfig{$key}[32] eq '' && $ovpnconfig{$key}[3] eq 'host'){
$ovpnconfig{$key}[2] =~ s/ /_/gi;
open ( CCDRWCONF,'>',"/var/ipfire/ovpn/ccd/$ovpnconfig{$key}[2]") or die "Unable to create clientconfigfile $!";
print CCDRWCONF "# OpenVPN Clientconfig from CCD extension by Copymaster#\n\n";
print CCDRWCONF "#This client uses the dynamic pool\n\n";