From 53a0c2b77ecae3ebb23bee81afb5dca62bd1f3fe Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Tue, 23 Jul 2019 16:10:15 -0500 Subject: [PATCH] Updated ssh keychain aliases. --- sh/aliases | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sh/aliases b/sh/aliases index 7ca19b4..23ae1d4 100644 --- a/sh/aliases +++ b/sh/aliases @@ -170,11 +170,13 @@ case "$hostenv" in alias open='kde-open5' alias ssh='eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && ssh' alias scp='eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && scp' + alias rsync='eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && rsync' my_git() { case $* in - ( push* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git push "$@" ;; - ( pull* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git pull "$@" ;; - ( * ) /usr/bin/git "$@" ;; + ( push* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git push "$@" ;; + ( pull* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git pull "$@" ;; + ( remote* ) shift; eval $(/usr/bin/keychain --eval --agents ssh --quick --quiet --timeout 480 ~/.ssh/id_rsa) && /usr/bin/git remote "$@" ;; + ( * ) /usr/bin/git "$@" ;; esac } alias git='my_git' @@ -185,7 +187,17 @@ case "$hostenv" in alias ls='ls --color=auto --literal' alias top='top -o cpu' alias ssh='if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && ssh' + alias scp='if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && scp' alias rsync='if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && rsync' + my_git() { + case $* in + ( push* ) shift; if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && /usr/local/bin/git push "$@" ;; + ( pull* ) shift; if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && /usr/local/bin/git pull "$@" ;; + ( remote* ) shift; if [[ `ssh-add -l` == "The agent has no identities." ]]; then ssh-add -t 28800; fi && /usr/local/bin/git remote "$@" ;; + ( * ) /usr/local/bin/git "$@" ;; + esac + } + alias git='my_git' alias man='man -M /usr/local/opt/coreutils/libexec/gnuman:$MANPATH' alias pipes='pipes.sh -t 3 -f 60 -r 8000' ;;