Add git ssh key wrapper
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
16
hosts/elara/users/nikara/configs/console/git/git-ssh-key-wrapper.sh
Executable file
16
hosts/elara/users/nikara/configs/console/git/git-ssh-key-wrapper.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
key="$HOME/.ssh/ssh_personal_ed25519_key"
|
||||
|
||||
if [[ "$*" == *"git@github.com"* ]]; then
|
||||
if [[ "$*" == *"sas-institute-rnd-product/"* ||
|
||||
"$*" == *"sas-institute-rnd-internal/"* ||
|
||||
"$*" == *"sas-institute-rnd-pipeline-test/"* ||
|
||||
"$*" == *"_sasinst/"* ]]; then
|
||||
key="$HOME/.ssh/ssh_sas_ed25519_key"
|
||||
fi
|
||||
|
||||
exec ssh -i "$key" "$@"
|
||||
fi
|
||||
|
||||
exec ssh "$@"
|
Reference in New Issue
Block a user