1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/bin/.local/bin/getpassword

13 lines
476 B
Plaintext
Raw Normal View History

#!/bin/sh
2019-09-27 16:29:41 +00:00
case $1 in
gmail) SERVER="imap.gmail.com"; LOGIN="alrayyes@gmail.com";;
andthensome) SERVER="imap.gmail.com"; LOGIN="ryan@andthensome.nl";;
ryankes) SERVER="imap.mailbox.org"; LOGIN="ryan@ryankes.eu";;
rss) SERVER="rss.higherlearning.eu"; LOGIN="alrayyes";;
*) echo "Unknown argument!"; exit 1;;
esac
PATTERN="machine $SERVER login $LOGIN"
gpg2 -q --for-your-eyes-only --no-tty -d ~/.authinfo.gpg | awk -v pattern="$PATTERN" '$0~pattern {print $NF}'