OpenVPN: tidy systemd restart-after-sleep unit (#450653)

This commit is contained in:
h7x4
2025-10-19 15:34:58 +00:00
committed by GitHub
@@ -85,13 +85,12 @@ let
restartService = optionalAttrs cfg.restartAfterSleep {
openvpn-restart = {
wantedBy = [ "sleep.target" ];
path = [ pkgs.procps ];
script =
let
unitNames = map (n: "openvpn-${n}.service") (builtins.attrNames cfg.servers);
in
"systemctl try-restart ${lib.escapeShellArgs unitNames}";
description = "Sends a signal to OpenVPN process to trigger a restart after return from sleep";
description = "Restart system OpenVPN connections when returning from sleep";
};
};