[feat] add ssh agent autostart switch
This commit is contained in:
parent
2b8b39dbc2
commit
413c9be5ce
@ -26,9 +26,11 @@
|
|||||||
{{- $installNode := promptBoolOnce . "installNode" "install nodejs bin" true -}}
|
{{- $installNode := promptBoolOnce . "installNode" "install nodejs bin" true -}}
|
||||||
{{- $installRust := promptBoolOnce . "installRust" "install rust bin" true -}}
|
{{- $installRust := promptBoolOnce . "installRust" "install rust bin" true -}}
|
||||||
{{- $enableTmux := promptBoolOnce . "enableTmux" "install enable tmux autostart" true -}}
|
{{- $enableTmux := promptBoolOnce . "enableTmux" "install enable tmux autostart" true -}}
|
||||||
|
{{- $enableSSHAgent := promptBoolOnce . "enableSSHAgent" "install enable ssh agent autostart" true -}}
|
||||||
|
|
||||||
[data.shell]
|
[data.shell]
|
||||||
tmux = {{ $enableTmux }}
|
tmux = {{ $enableTmux }}
|
||||||
|
ssh_agent = {{ $enableSSHAgent }}
|
||||||
|
|
||||||
[data.gitconfig]
|
[data.gitconfig]
|
||||||
email = {{ $email | quote }}
|
email = {{ $email | quote }}
|
||||||
|
@ -10,8 +10,8 @@ function start_agent {
|
|||||||
/usr/bin/ssh-add;
|
/usr/bin/ssh-add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{ if .shell.ssh_agent }}
|
||||||
# Source SSH settings, if applicable
|
# Source SSH settings, if applicable
|
||||||
|
|
||||||
if [ -f "${SSH_ENV}" ]; then
|
if [ -f "${SSH_ENV}" ]; then
|
||||||
. "${SSH_ENV}" > /dev/null
|
. "${SSH_ENV}" > /dev/null
|
||||||
#ps ${SSH_AGENT_PID} doesn't work under cywgin
|
#ps ${SSH_AGENT_PID} doesn't work under cywgin
|
||||||
@ -21,6 +21,7 @@ if [ -f "${SSH_ENV}" ]; then
|
|||||||
else
|
else
|
||||||
start_agent;
|
start_agent;
|
||||||
fi
|
fi
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
function envf {
|
function envf {
|
||||||
if [ ! -f "$1" ]; then
|
if [ ! -f "$1" ]; then
|
Loading…
Reference in New Issue
Block a user