Skip to content

Commit

Permalink
Revert "openvpn service: source up/down scripts"
Browse files Browse the repository at this point in the history
This reverts commit 50ad243.
  • Loading branch information
grahamc committed Apr 26, 2017
1 parent 7deb425 commit bdd89fa
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions nixos/modules/services/networking/openvpn.nix
Expand Up @@ -28,26 +28,16 @@ let
fi
done
${cfg.up}
${optionalString cfg.updateResolvConf
"${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf"}
${optionalString (cfg.up != "") "source ${userSuppliedUpScript}"}
'';

downScript = ''
#! /bin/sh
export PATH=${path}
${optionalString cfg.updateResolvConf
"${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf"}
${optionalString (cfg.down != "") "source ${userSuppliedDownScript}"}
'';

userSuppliedUpScript = pkgs.writeScript "openvpn-${name}-userSuppliedUpScript" ''
${cfg.up}
'';

userSuppliedDownScript = pkgs.writeScript "openvpn-${name}-userSuppliedDownScript" ''
${cfg.down}
'';

Expand Down Expand Up @@ -143,15 +133,15 @@ in
default = "";
type = types.lines;
description = ''
Shell script sourced by NixOS generated script when the instance is starting.
Shell commands executed when the instance is starting.
'';
};

down = mkOption {
default = "";
type = types.lines;
description = ''
Shell script sourced by NixOS generated script when the instance is shutting down.
Shell commands executed when the instance is shutting down.
'';
};

Expand Down

0 comments on commit bdd89fa

Please sign in to comment.