Commit 6f8c4897 authored by Robert Labudda's avatar Robert Labudda
Browse files

getpassword.sh

parent 4d3cb3fe
#!/bin/bash
# ~/bin/getpassword.sh
NAME=$1
if [ -e "$HOME/.passwords/$NAME.asc" ]
then
gpg -o - --for-your-eyes-only -d $HOME/.passwords/$NAME.asc 2> /dev/null
elif [ -e "$HOME/.passwords/$NAME.gpg" ]
then
gpg -o - --for-your-eyes-only -d $HOME/.passwords/$NAME.gpg 2> /dev/null
elif [ -e "$HOME/.passwords/$NAME.txt" ]
then
cat $HOME/.passwords/$NAME.txt
else
echo -e "SETDESC Please enter password for $NAME\nSETPROMPT Password:\nGETPIN" | \
pinentry | \
grep 'D ' | \
cut -c 3- -
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment