openvpn ccd: Minor fixes: iroute, delete route line.

Fixed several bugs:

1) iroute line not correctly printed in ccd file
2) route line was not deleted from server.conf when deleting a client
3) Routebox (client has access to these networks on ipfire site) did not show green,orange and blue when no static route was defined on ipfire
4) Green is no longer selected as default route in clientconfig.

Tested all Options with Windows 7 Client and Linux Mint 12
This commit is contained in:
Alexander Marx
2012-11-21 10:31:12 +01:00
committed by Michael Tremer
parent 83920cfcd5
commit 52d08bcbd2
4 changed files with 153 additions and 115 deletions

View File

@@ -5,10 +5,11 @@ my %ovpnconfig=();
my @serverconf=();
my $greennet;
my $greensubnet;
my $running='off';
require '/var/ipfire/general-functions.pl';
if ( -e "/var/run/openvpn.pid"){
$running='on';
system('/usr/local/bin/openvpnctrl', '-k');
}
@@ -41,5 +42,7 @@ foreach my $key (keys %ovpnconfig){
$ovpnconfig{$key}[32] = 'dynamic';
}
&General::writehasharray("/var/ipfire/ovpn/ovpnconfig", \%ovpnconfig);
system('/usr/local/bin/openvpnctrl', '-s');
if ($running eq 'on')
{
system('/usr/local/bin/openvpnctrl', '-s');
}