From: Michael Tremer Date: Thu, 9 Apr 2015 15:18:44 +0000 (+0200) Subject: openvpn: Remove stat files when connections are removed X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d72de3da144ea4edff4d1c30ff555e8cd43d8b18;p=people%2Fms%2Fipfire-2.x.git openvpn: Remove stat files when connections are removed --- diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index ed592948fd..1a29be0381 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -1237,6 +1237,9 @@ SETTINGS_ERROR: while ($file = glob("${General::swroot}/ovpn/n2nconf/*")) { system ("rm -rf $file"); } + while ($file = glob("/var/run/openvpn/*-n2n")) { + unlink $file; + } # Remove everything from the collectd configuration &writecollectdconf(); @@ -2364,6 +2367,8 @@ if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') { if (-e "${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") { rmdir ("${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") || die "Kann Verzeichnis nicht loeschen: $!"; } + + unlink("/var/run/openvpn/$confighash{$cgiparams{'KEY'}}[1]-n2n"); } unlink ("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem");