diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-09-18 12:14:19 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-09-18 12:14:19 -0300 |
commit | 8d8ceaebb92cb5036c81cc39f711ce72bb942a8d (patch) | |
tree | 6e290ea25ed45d95a9d0be3a8b6602563f2582e7 | |
parent | b5269ea9c2c88f6e12688280dd0dd92eb99716f3 (diff) | |
download | keyringer-8d8ceaebb92cb5036c81cc39f711ce72bb942a8d.tar.gz keyringer-8d8ceaebb92cb5036c81cc39f711ce72bb942a8d.tar.bz2 |
Testing $RECIPIENT existence at keyringer_set_env
-rw-r--r-- | lib/keyringer/functions | 7 | ||||
-rwxr-xr-x | share/keyringer/append | 3 | ||||
-rwxr-xr-x | share/keyringer/edit | 3 | ||||
-rwxr-xr-x | share/keyringer/encrypt | 3 | ||||
-rwxr-xr-x | share/keyringer/recipients | 3 | ||||
-rwxr-xr-x | share/keyringer/recrypt | 5 |
6 files changed, 7 insertions, 17 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 7545a52..adaf576 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -157,7 +157,7 @@ function keyringer_git_ignore { fi } -# Set needed environment variables. +# Set needed environment variables and do basic checks. function keyringer_set_env { if [ -z "$1" ]; then echo "Error: missing arguments for keyringer_set_env" @@ -170,4 +170,9 @@ function keyringer_set_env { KEYDIR="$BASEDIR/keys" RECIPIENTS="$BASEDIR/config/recipients" OPTIONS="$BASEDIR/config/options" + + if [ ! -f "$RECIPIENTS" ]; then + echo "No recipient config was found" + exit 1 + fi } diff --git a/share/keyringer/append b/share/keyringer/append index 1e91d6f..fbfe49f 100755 --- a/share/keyringer/append +++ b/share/keyringer/append @@ -14,9 +14,6 @@ FILE="`keyringer_filename $2`" if [ -z "$FILE" ]; then echo "Usage: keyringer <keyring> `basename $0` <file>" exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 elif [ ! -f "$KEYDIR/$FILE" ]; then echo "File not found: $KEYDIR/$FILE" exit 1 diff --git a/share/keyringer/edit b/share/keyringer/edit index 264c75f..dff42e6 100755 --- a/share/keyringer/edit +++ b/share/keyringer/edit @@ -14,9 +14,6 @@ FILE="`keyringer_filename $2`" if [ -z "$FILE" ]; then echo "Usage: keyringer <keyring> `basename $0` <file>" exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 elif [ ! -f "$KEYDIR/$FILE" ]; then echo "File not found: $KEYDIR/$FILE" exit 1 diff --git a/share/keyringer/encrypt b/share/keyringer/encrypt index d1218ae..1f0ec47 100755 --- a/share/keyringer/encrypt +++ b/share/keyringer/encrypt @@ -15,9 +15,6 @@ FILE="`keyringer_filename $2`" if [ -z "$FILE" ]; then echo "Usage: keyringer <keyring> `basename $0` <file>" exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 fi # Encrypt diff --git a/share/keyringer/recipients b/share/keyringer/recipients index 7048211..3410b3d 100755 --- a/share/keyringer/recipients +++ b/share/keyringer/recipients @@ -14,9 +14,6 @@ COMMAND="$2" if [ -z "$COMMAND" ]; then echo "Usage: keyringer <keyring> `basename $0` <command> [arguments]" exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 fi if [ "$COMMAND" == "ls" ]; then diff --git a/share/keyringer/recrypt b/share/keyringer/recrypt index f0e15a3..32a8a39 100755 --- a/share/keyringer/recrypt +++ b/share/keyringer/recrypt @@ -14,10 +14,7 @@ FILE="`keyringer_filename $2`" if [ -z "$FILE" ]; then echo "Usage: keyringer <keyring> `basename $0` <file>" exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 -elif [ ! -f "$KEYDIR/$FILE" ]; then +if [ ! -f "$KEYDIR/$FILE" ]; then echo "File not found: $KEYDIR/$FILE" exit 1 fi |