mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-28 03:45:04 +00:00
Fix var names from pwd.sh
This commit is contained in:
parent
bb75af004b
commit
73efa6d72a
15
purse.sh
15
purse.sh
@ -12,8 +12,8 @@ today="$(date +%F)"
|
|||||||
gpg="$(command -v gpg || command -v gpg2)"
|
gpg="$(command -v gpg || command -v gpg2)"
|
||||||
gpg_conf="${HOME}/.gnupg/gpg.conf"
|
gpg_conf="${HOME}/.gnupg/gpg.conf"
|
||||||
|
|
||||||
clip="${PWDSH_CLIP:=xclip}" # clipboard, 'pbcopy' on macOS
|
clip="${PURSE_CLIP:=xclip}" # clipboard, 'pbcopy' on macOS
|
||||||
clip_args=${PWDSH_CLIP_ARGS:=} # args to pass to copy command
|
clip_args=${PURSE_CLIP_ARGS:=} # args to pass to copy command
|
||||||
clip_dest="${PURSE_DEST:=clipboard}" # set to 'screen' to print to stdout
|
clip_dest="${PURSE_DEST:=clipboard}" # set to 'screen' to print to stdout
|
||||||
clip_timeout="${PURSE_TIME:=10}" # seconds to clear clipboard/screen
|
clip_timeout="${PURSE_TIME:=10}" # seconds to clear clipboard/screen
|
||||||
comment="${PURSE_COMMENT:=}" # *unencrypted* comment in files
|
comment="${PURSE_COMMENT:=}" # *unencrypted* comment in files
|
||||||
@ -210,7 +210,7 @@ list_entry () {
|
|||||||
backup () {
|
backup () {
|
||||||
# Archive index, safe and configuration.
|
# Archive index, safe and configuration.
|
||||||
|
|
||||||
if [[ ! -f ${safe_backup} ]] ; then
|
if [[ ! -f "${safe_backup}" ]] ; then
|
||||||
if [[ -f "${safe_ix}" && -d "${safe_dir}" ]] ; then
|
if [[ -f "${safe_ix}" && -d "${safe_dir}" ]] ; then
|
||||||
cp "${gpg_conf}" "gpg.conf.${today}"
|
cp "${gpg_conf}" "gpg.conf.${today}"
|
||||||
tar cf "${safe_backup}" "${safe_dir}" "${safe_ix}" \
|
tar cf "${safe_backup}" "${safe_dir}" "${safe_ix}" \
|
||||||
@ -246,18 +246,15 @@ new_entry () {
|
|||||||
Username (Enter to generate): " username
|
Username (Enter to generate): " username
|
||||||
else username="${2}" ; fi
|
else username="${2}" ; fi
|
||||||
if [[ -z "${username}" ]] ; then
|
if [[ -z "${username}" ]] ; then
|
||||||
username=$(generate_user "$@")
|
username=$(generate_user "$@") ; fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${3+x}" ]] ; then
|
if [[ -z "${3+x}" ]] ; then
|
||||||
get_pass "Password for \"${username}\" (Enter to generate): "
|
get_pass "Password for \"${username}\" (Enter to generate): "
|
||||||
userpass="${password}"
|
userpass="${password}" ; fi
|
||||||
fi
|
|
||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
if [[ -z "${password}" ]] ; then
|
if [[ -z "${password}" ]] ; then
|
||||||
userpass=$(generate_pass "$@")
|
userpass=$(generate_pass "$@") ; fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print_help () {
|
print_help () {
|
||||||
|
Loading…
Reference in New Issue
Block a user