Update 2 files

- /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-linux.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-darwin.tmpl
This commit is contained in:
Brian Zalewski 2023-01-26 08:50:54 +00:00
parent e0b2955db0
commit c8be2b007a
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
{{ end -}}

View file

@ -0,0 +1,16 @@
{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
if command -v nmcli > /dev/null; then
nmcli connection import type openvpn file '{{ vpn_connection.file }}'
nmcli connection modify '{{ ovpn_name }}' +vpn.data username={{ vpn_connection.username }}
nmcli connection modify '{{ ovpn_name }}' vpn.secrets 'password={{ vpn_connection.password }}'
nmcli connection modify '{{ ovpn_name }}' +vpn.data password-flags=0
else
logg info '`nmcli` is unavailable'
fi
{{ end -}}