X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/56f75bf983cc8b70ccde224e50241c45a84a63b8..0e550f2efb0c56e510dd5c2ef4e9d764624dd026:/bin/old/ssh-gpg diff --git a/bin/old/ssh-gpg b/bin/old/ssh-gpg new file mode 100755 index 0000000..736dadc --- /dev/null +++ b/bin/old/ssh-gpg @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +remote_socket="$(ssh "$@" gpgconf --list-dirs agent-socket)" +local_socket="$(gpgconf --list-dirs agent-extra-socket)" +[[ ! -S "$local_socket" ]] && local_socket="$(gpgconf --list-dirs agent-socket)" +[[ ! -S "$local_socket" ]] && gpg-connect-agent /bye + +ssh -R"$remote_socket":"$local_socket" "$@"