hotfix OVPN restart

This commit is contained in:
kirillius 2025-10-07 16:44:30 +03:00
parent 1f4a288375
commit a352adf880
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import ru.kirillius.pf.sdn.web.WebService;
import ru.kirillius.utils.logging.SystemLogger;
import java.io.IOException;
import java.util.regex.Pattern;
/**
* Component integrating with OpenVPN to expose management RPC and synchronize route exports.
@ -59,7 +60,7 @@ public final class OVPN extends AbstractComponent<OVPN.OVPNConfig> {
@ProtectedMethod
public String restartSystemService() {
try (var shell = new ShellExecutor(config.shellConfig)) {
return shell.executeCommand(new String[]{config.restartCommand});
return shell.executeCommand(config.restartCommand.split(Pattern.quote(" ")));
} catch (IOException e) {
SystemLogger.error("Error when trying to restart OVPN", CTX, e);
return e.toString();