aboutsummaryrefslogblamecommitdiff
path: root/.local/bin/ssh-askpass
blob: d3bbc91a4897361aef3b8465b20db7a373149429 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                                                                  
#!/usr/bin/env bash
# Remember to export SSH_ASKPASS=~/.local/bin/ssh-askpass in your .bashrc
RESULT=$(pinentry-curses --ttytype=xterm-color --lc-ctype=en_US.UTF8 --ttyname=/dev/tty <<END | grep -E '^(D|ERR)'
SETDESC Enter your SSH password:
SETPROMPT
GETPIN
END
)

if [ "$RESULT" == "ERR 111 canceled" ]; then
    exit 255
else
    echo ${RESULT:2:${#RESULT}-2}   
fi