From c035fb4b9ee924d6f0cf94d77fbcb13af322e319 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 27 Mar 2023 06:09:59 +0000 Subject: [PATCH] Update file run_onchange_after_24-vpn-linux.tmpl --- .../universal/run_onchange_after_24-vpn-linux.tmpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl index 0605e367..c532f18e 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl @@ -1,16 +1,14 @@ {{- if (eq .host.distro.family "linux") -}} #!/usr/bin/env bash +{{ $ovpnUsername := (env "OVPN_USERNAME") }} {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "OVPN_USERNAME")) }} -{{ $ovpnUsername := includeTemplate "secrets/OVPN_USERNAME" | decrypt }} -{{ else }} -{{ $ovpnUsername := (env "OVPN_USERNAME") }} +{{ $ovpnUsername := (includeTemplate "secrets/OVPN_USERNAME" | decrypt) }} {{ end }} +{{ $ovpnPassword := (env "OVPN_PASSWORD") }} {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "OVPN_PASSWORD")) }} -{{ $ovpnPassword := includeTemplate "secrets/OVPN_PASSWORD" | decrypt }} -{{ else }} -{{ $ovpnPassword := (env "OVPN_PASSWORD") }} +{{ $ovpnPassword := (includeTemplate "secrets/OVPN_PASSWORD" | decrypt) }} {{ end }} {{ includeTemplate "universal/profile" }}