]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
ovpnmain.cgi: Reload the server after changing advanced settings
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Apr 2024 17:49:30 +0000 (19:49 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 2 Jun 2025 19:46:32 +0000 (19:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index e6dc9b7417444e07dc69d2cb40cdb02924937788..23cb95d512c32a302847ed9c57340f9662ba0f51 100644 (file)
@@ -1027,8 +1027,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) {
         $errormessage = $Lang::tr{'invalid input for max clients'};
         goto ADV_ERROR;
     }
-    &General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
-    &writeserverconf();#hier ok
+
+       # Store our configuration
+       &General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
+
+       # Write the server configuration
+       &writeserverconf();
+
+       # Reload the server if it is enabled
+       if ($vpnsettings{'ENABLED'} eq "on") {
+               &General::system("/usr/local/bin/openvpnctrl", "rw", "reload");
+       }
 }
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq 'net' && $cgiparams{'SIDE'} eq 'server')