lol

nixos/openvpn: use writeShellScript

Previously the upScript would fail with

Syntax error: "(" unexpected (expecting "done")

on line 7 if /bin/sh is not bash.

authored by

Robert Schütz and committed by
Robert Schütz
9e1d4dff 2700684d

+2 -4
+2 -4
nixos/modules/services/networking/openvpn.nix
··· 14 14 path = makeBinPath (getAttr "openvpn-${name}" config.systemd.services).path; 15 15 16 16 upScript = '' 17 - #! /bin/sh 18 17 export PATH=${path} 19 18 20 19 # For convenience in client scripts, extract the remote domain ··· 34 33 ''; 35 34 36 35 downScript = '' 37 - #! /bin/sh 38 36 export PATH=${path} 39 37 ${optionalString cfg.updateResolvConf 40 38 "${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf"} ··· 47 45 ${optionalString (cfg.up != "" || cfg.down != "" || cfg.updateResolvConf) "script-security 2"} 48 46 ${cfg.config} 49 47 ${optionalString (cfg.up != "" || cfg.updateResolvConf) 50 - "up ${pkgs.writeScript "openvpn-${name}-up" upScript}"} 48 + "up ${pkgs.writeShellScript "openvpn-${name}-up" upScript}"} 51 49 ${optionalString (cfg.down != "" || cfg.updateResolvConf) 52 - "down ${pkgs.writeScript "openvpn-${name}-down" downScript}"} 50 + "down ${pkgs.writeShellScript "openvpn-${name}-down" downScript}"} 53 51 ${optionalString (cfg.authUserPass != null) 54 52 "auth-user-pass ${pkgs.writeText "openvpn-credentials-${name}" '' 55 53 ${cfg.authUserPass.username}