From 73efa6d72a74fe27bf9d499b7d3bd992c0ad2acf Mon Sep 17 00:00:00 2001 From: drduh Date: Thu, 4 Jul 2024 16:28:27 -0700 Subject: [PATCH] Fix var names from pwd.sh --- purse.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/purse.sh b/purse.sh index e7b1a28..4fdd003 100755 --- a/purse.sh +++ b/purse.sh @@ -12,8 +12,8 @@ today="$(date +%F)" gpg="$(command -v gpg || command -v gpg2)" gpg_conf="${HOME}/.gnupg/gpg.conf" -clip="${PWDSH_CLIP:=xclip}" # clipboard, 'pbcopy' on macOS -clip_args=${PWDSH_CLIP_ARGS:=} # args to pass to copy command +clip="${PURSE_CLIP:=xclip}" # clipboard, 'pbcopy' on macOS +clip_args=${PURSE_CLIP_ARGS:=} # args to pass to copy command clip_dest="${PURSE_DEST:=clipboard}" # set to 'screen' to print to stdout clip_timeout="${PURSE_TIME:=10}" # seconds to clear clipboard/screen comment="${PURSE_COMMENT:=}" # *unencrypted* comment in files @@ -210,7 +210,7 @@ list_entry () { backup () { # Archive index, safe and configuration. - if [[ ! -f ${safe_backup} ]] ; then + if [[ ! -f "${safe_backup}" ]] ; then if [[ -f "${safe_ix}" && -d "${safe_dir}" ]] ; then cp "${gpg_conf}" "gpg.conf.${today}" tar cf "${safe_backup}" "${safe_dir}" "${safe_ix}" \ @@ -246,18 +246,15 @@ new_entry () { Username (Enter to generate): " username else username="${2}" ; fi if [[ -z "${username}" ]] ; then - username=$(generate_user "$@") - fi + username=$(generate_user "$@") ; fi if [[ -z "${3+x}" ]] ; then get_pass "Password for \"${username}\" (Enter to generate): " - userpass="${password}" - fi + userpass="${password}" ; fi printf "\n" if [[ -z "${password}" ]] ; then - userpass=$(generate_pass "$@") - fi + userpass=$(generate_pass "$@") ; fi } print_help () {