]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Testing $RECIPIENT existence at keyringer_set_env
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 18 Sep 2010 15:14:19 +0000 (12:14 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 18 Sep 2010 15:14:19 +0000 (12:14 -0300)
lib/keyringer/functions
share/keyringer/append
share/keyringer/edit
share/keyringer/encrypt
share/keyringer/recipients
share/keyringer/recrypt

index 7545a52f229467d6f297c3a428a283a2c923106d..adaf576dd3814f0ecba3cfcb559c32109d5918cf 100644 (file)
@@ -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
 }
index 1e91d6fed238c15a4c04b7daf6d35307a5ce9977..fbfe49f8846503724b86a62c5a62e607922fdf60 100755 (executable)
@@ -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
index 264c75f8d1819fab6bbcae753aa31193d9b46c10..dff42e605882d1b0898ea7af1ed5c7fe7bd1132b 100755 (executable)
@@ -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
index d1218ae2942e9334f0d5b6d2c34a44d18109c8ee..1f0ec470b3d757dc7311752892b64c694954de19 100755 (executable)
@@ -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
index 7048211fe9367dbf79129600560513f526c39e6b..3410b3d38ce032311f9bbd68325cf0e3f2376e9f 100755 (executable)
@@ -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
index f0e15a315f942a2dcf431cf475f77960e15f83ab..32a8a39a3c70e8485b343d852b6dcb95a9b40482 100755 (executable)
@@ -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