mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-25 18:32:57 +02:00
ovpnmain.cgi: Remove duplicate code to remove a connection
This commit is contained in:
committed by
Michael Tremer
parent
323be7c44f
commit
82e454712b
@@ -3076,36 +3076,6 @@ END
|
||||
$errormessage = $Lang::tr{'invalid key'};
|
||||
}
|
||||
|
||||
###
|
||||
### Remove connection
|
||||
###
|
||||
} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'remove'}) {
|
||||
&General::readhash("${General::swroot}/ovpn/settings", \%vpnsettings);
|
||||
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
|
||||
|
||||
if ($confighash{$cgiparams{'KEY'}}) {
|
||||
# if ($vpnsettings{'ENABLED'} eq 'on' ||
|
||||
# $vpnsettings{'ENABLED_BLUE'} eq 'on') {
|
||||
# system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'});
|
||||
# }
|
||||
unlink ("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem");
|
||||
unlink ("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12");
|
||||
delete $confighash{$cgiparams{'KEY'}};
|
||||
|
||||
# Delete RRD's for collectd
|
||||
system("/usr/local/bin/openvpnctrl", "-drrd", "$confighash{$cgiparams{'KEY'}}[1]", "&>/dev/null");
|
||||
|
||||
&General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
|
||||
#&writeserverconf();
|
||||
} else {
|
||||
$errormessage = $Lang::tr{'invalid key'};
|
||||
}
|
||||
#test33
|
||||
|
||||
###
|
||||
### Choose between adding a host-net or net-net connection
|
||||
###
|
||||
|
||||
###
|
||||
# m.a.d net2net
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user