]> 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, 23 Sep 2024 11:24:08 +0000 (13:24 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index ff01106ba6b2cc7dfc2e5e0a75dd23bff62fa4db..f792aafb65f3782f08335b2f68879f9a294c0777 100755 (executable)
@@ -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')