Wrap scripts in scripts
This commit is contained in:
parent
4aa532bf4d
commit
d4980a2d5e
@ -265,18 +265,18 @@ in {
|
|||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
requires = [ "network.target" ];
|
requires = [ "network.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStartPre = ''
|
ExecStartPre = pkgs.writeShellScript "adguardsProxyPrestart.sh"
|
||||||
cp ${generate-config-file cfg} $RUNTIME_DIRECTORY/config.yaml
|
"cp ${generate-config-file cfg} $RUNTIME_DIRECTORY/config.yaml";
|
||||||
'';
|
ExecStart = pkgs.writeShellScript "adguardProxyStart.sh"
|
||||||
ExecStart = concatStringsSep " " [
|
(concatStringsSep " " [
|
||||||
"${pkgs.adguardhome}/bin/adguardhome"
|
"${pkgs.adguardhome}/bin/adguardhome"
|
||||||
"--no-check-update"
|
"--no-check-update"
|
||||||
"--work-dir /var/lib/adguard-dns-proxy"
|
"--work-dir /var/lib/adguard-dns-proxy"
|
||||||
"--pidfile /run/adguard-dns-proxy.pid"
|
"--pidfile /run/adguard-dns-proxy.pid"
|
||||||
"--host ${cfg.http.listen-ip}"
|
"--host ${cfg.http.listen-ip}"
|
||||||
"--port ${toString cfg.http.listen-port}"
|
"--port ${toString cfg.http.listen-port}"
|
||||||
"--config $RUNTIME_DIRECTORY/config.yaml"
|
"--config $RUNTIME_DIRECTORY/config.yaml"
|
||||||
];
|
]);
|
||||||
AmbientCapabilities = optional
|
AmbientCapabilities = optional
|
||||||
(cfg.dns.listen-port <= 1024 || cfg.http.listen-port <= 1024)
|
(cfg.dns.listen-port <= 1024 || cfg.http.listen-port <= 1024)
|
||||||
[ "CAP_NET_BIND_SERVICE" ];
|
[ "CAP_NET_BIND_SERVICE" ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user