From 33c34aff2fb42268f45c5563f767266e27c58a9b Mon Sep 17 00:00:00 2001 From: gnidorah Date: Wed, 28 Mar 2018 08:32:29 +0300 Subject: [PATCH] hans, iodine: correct script --- nixos/modules/services/networking/hans.nix | 20 ++------------------ nixos/modules/services/networking/iodine.nix | 20 ++------------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/networking/hans.nix b/nixos/modules/services/networking/hans.nix index 1b54a822aaee..4579154d78fa 100644 --- a/nixos/modules/services/networking/hans.nix +++ b/nixos/modules/services/networking/hans.nix @@ -115,18 +115,10 @@ in description = "hans client - ${name}"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - preStart = '' - cat > /run/hans/${name}-script << EOF - #!/bin/sh - ${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.extraConfig} -c ${cfg.server} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"} - EOF - chmod 700 /run/hans/${name}-script - ''; - script = "/run/hans/${name}-script"; + script = "${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.extraConfig} -c ${cfg.server} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}"; serviceConfig = { RestartSec = "30s"; Restart = "always"; - RuntimeDirectory = [ "hans" ]; }; }; in @@ -139,15 +131,7 @@ in description = "hans, ip over icmp server daemon"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - preStart = '' - cat > /run/hans/script << EOF - #!/bin/sh - ${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.server.extraConfig} -s ${cfg.server.ip} ${optionalString cfg.server.systemPings "-r"} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"} - EOF - chmod 700 /run/hans/script - ''; - script = "/run/hans/script"; - serviceConfig.RuntimeDirectory = [ "hans" ]; + script = "${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.server.extraConfig} -s ${cfg.server.ip} ${optionalString cfg.server.systemPings "-r"} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}"; }; }; diff --git a/nixos/modules/services/networking/iodine.nix b/nixos/modules/services/networking/iodine.nix index 66569a7e9127..709c36ee54f0 100644 --- a/nixos/modules/services/networking/iodine.nix +++ b/nixos/modules/services/networking/iodine.nix @@ -120,18 +120,10 @@ in description = "iodine client - ${name}"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - preStart = '' - cat > /run/iodine/${name}-script << EOF - #!/bin/sh - ${pkgs.iodine}/bin/iodine -f -u ${iodinedUser} ${cfg.extraConfig} ${optionalString (cfg.passwordFile != "") "-P $(cat \"${cfg.passwordFile}\")"} ${cfg.relay} ${cfg.server} - EOF - chmod 700 /run/iodine/${name}-script - ''; - script = "/run/iodine/${name}-script"; + script = "${pkgs.iodine}/bin/iodine -f -u ${iodinedUser} ${cfg.extraConfig} ${optionalString (cfg.passwordFile != "") "-P $(cat \"${cfg.passwordFile}\")"} ${cfg.relay} ${cfg.server}"; serviceConfig = { RestartSec = "30s"; Restart = "always"; - RuntimeDirectory = [ "iodine" ]; }; }; in @@ -144,15 +136,7 @@ in description = "iodine, ip over dns server daemon"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - preStart = '' - cat > /run/iodined/script << EOF - #!/bin/sh - ${pkgs.iodine}/bin/iodined -f -u ${iodinedUser} ${cfg.server.extraConfig} ${optionalString (cfg.passwordFile != "") "-P $(cat \"${cfg.passwordFile}\")"} ${cfg.server.ip} ${cfg.server.domain} - EOF - chmod 700 /run/iodined/script - ''; - script = "/run/iodined/script"; - serviceConfig.RuntimeDirectory = [ "iodined" ]; + script = "${pkgs.iodine}/bin/iodined -f -u ${iodinedUser} ${cfg.server.extraConfig} ${optionalString (cfg.passwordFile != "") "-P $(cat \"${cfg.passwordFile}\")"} ${cfg.server.ip} ${cfg.server.domain}"; }; };