diff options
| author | mail_redacted_for_web | 2026-05-23 11:33:28 +0200 |
|---|---|---|
| committer | mail_redacted_for_web | 2026-05-23 11:33:28 +0200 |
| commit | bed2c80ef5174bc4b1d77443bbc48702fcdd6352 (patch) | |
| tree | acccabb5044d40e3333473bb391175ac3bd4de32 | |
| parent | 97f55be373fa35d444f5e373ce636014f7d93ac6 (diff) | |
| download | dotfiles-bed2c80ef5174bc4b1d77443bbc48702fcdd6352.tar.bz2 | |
feat!: in add-sshagent-init, avoid typing the same passphrase more than once
| -rw-r--r-- | .bash/aliases.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/.bash/aliases.bash b/.bash/aliases.bash index acf7091..20274ad 100644 --- a/.bash/aliases.bash +++ b/.bash/aliases.bash @@ -91,12 +91,14 @@ alias sshr='ssh -o StrictHostKeyChecking=no' alias sshk='ssh -o PasswordAuthentication=yes -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no' alias sshg="ssh-with-gpg" function add-sshagent-init { - for KEY in "${SSHKEYS[@]}";do + declare -a ADDKEYS + for KEY in "${SSHKEYS[@]}"; do FFPRINT="$(ssh-keygen -Esha256 -lf "$KEY")" || return 1 if ! ssh-add -l 2>/dev/null | grep "$FFPRINT" >/dev/null; then - ssh-add -q "$KEY" + ADDKEYS+=( "$KEY" ) fi done + ssh-add -q "${ADDKEYS[@]}" } alias sshmaster='ssh -O' # ----- FS ----- # |
