summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:14:19 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:14:19 -0300
commit8d8ceaebb92cb5036c81cc39f711ce72bb942a8d (patch)
tree6e290ea25ed45d95a9d0be3a8b6602563f2582e7 /lib
parentb5269ea9c2c88f6e12688280dd0dd92eb99716f3 (diff)
downloadkeyringer-8d8ceaebb92cb5036c81cc39f711ce72bb942a8d.tar.gz
keyringer-8d8ceaebb92cb5036c81cc39f711ce72bb942a8d.tar.bz2
Testing $RECIPIENT existence at keyringer_set_env
Diffstat (limited to 'lib')
-rw-r--r--lib/keyringer/functions7
1 files changed, 6 insertions, 1 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
}