From 278f68e1e1398015a9de60ea2d6cf1ed0a1c87a5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 22 Dec 2010 10:54:26 +0000 Subject: bugfix: -z $NOVERSIONING is now -z "$NOVERSIONING" --- pwgrep.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'pwgrep.sh') diff --git a/pwgrep.sh b/pwgrep.sh index 0d322de..6908cf6 100755 --- a/pwgrep.sh +++ b/pwgrep.sh @@ -149,7 +149,7 @@ function pwgrep () { } function pwupdate () { - if [ -z $NOVERSIONING ]; then + if [ -z "$NOVERSIONING" ]; then info Updating repository $VERSIONUPDATE 2>&1 >/dev/null fi @@ -164,7 +164,7 @@ function pwedit () { gpg --output .$PWGREPDB -e -r $GPGKEYID .database && \ $WIPE .database && \ mv .$PWGREPDB $PWGREPDB && \ - [ -z $NOVERSIONING ] && $VERSIONCOMMIT + [ -z "$NOVERSIONING" ] && $VERSIONCOMMIT } function pwdbls () { @@ -207,7 +207,7 @@ function pwfadd () { gpg --output $PWFILEDIREXT/${outfile}.gpg -e -r $GPGKEYID $srcfile && \ - if [ -z $NOVERSIONING ]; then + if [ -z "$NOVERSIONING" ]; then $VERSIONADD $PWFILEDIREXT/${outfile}.gpg && $VERSIONCOMMIT fi } @@ -219,7 +219,7 @@ function pwfdel () { [ ! -e $PWFILEWORKDIR ] && error $PWFILEWORKDIR does not exist [ -z $name ] && error Missing argument - if [ -z $NOVERSIONING ]; then + if [ -z "$NOVERSIONING" ]; then # Wipe even encrypted file securely $WIPE $PWFILEDIREXT/${name}.gpg && \ touch $PWFILEDIREXT/${name}.gpg && $VERSIONCOMMIT && \ @@ -250,6 +250,7 @@ cat < - Using a specific DB + -a - Grepping all available DBs at once END } @@ -283,6 +284,12 @@ function set_opts () { PWGREPDB=$PWGREPDB.gpg set_opts ;; + -a*) + # All DBs at once + ALL=1 + ARGS=${ARGS[@]:2} + set_opts + ;; *) esac } -- cgit v1.2.3