~ajk/ssh-identity-wrapper

ref: 3776213380c637d91bea64ca1b519132475f38a6 ssh-identity-wrapper/ssh-identity-wrapper.sh -rwxr-xr-x 377 bytes
37762133 — Andrew Kay Rename to ssh-identity-wrapper 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

cd $(dirname -- "$(readlink -f -- "$BASH_SOURCE")")

source ./ssh-identity-wrapper.conf.sh

read -p "Identity: " identity

if [ ! -v identities[$identity] ]; then
    echo "Invalid identity"
    exit 1
fi

key_path=${identities[$identity]}

if [ ! -f $key_path ]; then
    echo "Invalid identity"
    exit 1
fi

SSH_AUTH_SOCK="" ssh -F /dev/null -i $key_path "$@"