Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robert Labudda
utils
Commits
6f8c4897
Commit
6f8c4897
authored
Feb 06, 2019
by
Robert Labudda
Browse files
getpassword.sh
parent
4d3cb3fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
getpassword.sh
0 → 100755
View file @
6f8c4897
#!/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
\n
SETPROMPT Password:
\n
GETPIN"
|
\
pinentry |
\
grep
'D '
|
\
cut
-c
3- -
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment