mirror of
https://github.com/octoleo/Purse.git
synced 2025-01-01 13:41:46 +00:00
Indent by 2 spaces throughout. Add example for copying password to clipboard on OS X.
This commit is contained in:
parent
62ce715108
commit
866bbff0eb
@ -28,6 +28,10 @@ Options can also be passed on the command line, e.g.,
|
|||||||
|
|
||||||
`./pwd.sh d dropbox` to delete the password called 'dropbox'.
|
`./pwd.sh d dropbox` to delete the password called 'dropbox'.
|
||||||
|
|
||||||
|
Combine with other programs by piping output, e.g.,
|
||||||
|
|
||||||
|
`./pwd.sh r github | grep github | cut -f1 -d ' ' | pbcopy` to copy a password to clipboard on OS X.
|
||||||
|
|
||||||
The script and `pwd.sh.safe` encrypted file can be safely shared between machines over public channels (Google Drive, Dropbox, etc).
|
The script and `pwd.sh.safe` encrypted file can be safely shared between machines over public channels (Google Drive, Dropbox, etc).
|
||||||
|
|
||||||
A sample `gpg.conf` configuration file is provided for your consideration.
|
A sample `gpg.conf` configuration file is provided for your consideration.
|
||||||
|
2
pwd.sh
2
pwd.sh
@ -23,6 +23,7 @@ get_pass () {
|
|||||||
|
|
||||||
password=''
|
password=''
|
||||||
prompt="${1}"
|
prompt="${1}"
|
||||||
|
|
||||||
while IFS= read -p "${prompt}" -r -s -n 1 char ; do
|
while IFS= read -p "${prompt}" -r -s -n 1 char ; do
|
||||||
if [[ ${char} == $'\0' ]] ; then
|
if [[ ${char} == $'\0' ]] ; then
|
||||||
break
|
break
|
||||||
@ -57,7 +58,6 @@ decrypt () {
|
|||||||
encrypt () {
|
encrypt () {
|
||||||
# Encrypt with a password.
|
# Encrypt with a password.
|
||||||
|
|
||||||
|
|
||||||
${gpg} \
|
${gpg} \
|
||||||
--symmetric --armor --batch --yes \
|
--symmetric --armor --batch --yes \
|
||||||
--passphrase-fd 3 \
|
--passphrase-fd 3 \
|
||||||
|
Loading…
Reference in New Issue
Block a user