Fallback to reading the password from the commandline.
This commit is contained in:
parent
c22fa4760b
commit
8a26e29218
7
.bashrc
7
.bashrc
|
@ -15,7 +15,12 @@ getkey() {
|
|||
KEYFILE=~/.keys/${1}
|
||||
|
||||
if [ -f ${KEYFILE} ]; then
|
||||
PASS=$(security find-internet-password -l ssh:scott@wallace.sh -gw)
|
||||
if [ -x /usr/bin/security ]; then
|
||||
PASS=$(/usr/bin/security find-internet-password -l ssh:scott@wallace.sh -gw)
|
||||
else
|
||||
read -sp "Password: " PASS
|
||||
fi
|
||||
|
||||
openssl rsautl -decrypt -inkey ~/.ssh/scott@wallace.sh -passin "pass:${PASS}" -in ${KEYFILE} 2>/dev/null
|
||||
else
|
||||
echo "No such key" >&2
|
||||
|
|
Loading…
Reference in a new issue