summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:49:45 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:49:45 -0300
commitf9e575896519e78788b0bb5cd2eb1f1f4840f88a (patch)
tree826ac7f9b24f6d4cf92d80ed76e9311447e6bf89 /lib
parent2aa6f0127bad78d4dc3279f104c4660ee47855a5 (diff)
downloadkeyringer-f9e575896519e78788b0bb5cd2eb1f1f4840f88a.tar.gz
keyringer-f9e575896519e78788b0bb5cd2eb1f1f4840f88a.tar.bz2
Checking for $BASEDIR and $OPTIONS at keyringer_set_env
Diffstat (limited to 'lib')
-rw-r--r--lib/keyringer/functions10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index d474666..96ca7e6 100644
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -171,6 +171,11 @@ function keyringer_set_env {
RECIPIENTS="$BASEDIR/config/recipients"
OPTIONS="$BASEDIR/config/options"
+ if [ -z "$BASEDIR" ]; then
+ keyringer_action_usage
+ exit 1
+ fi
+
if [ ! -f "$RECIPIENTS" ]; then
echo "No recipient config was found"
exit 1
@@ -180,6 +185,11 @@ function keyringer_set_env {
echo "You have to set EDITOR env variable"
exit 1
fi
+
+ if [ ! -f "$OPTIONS" ]; then
+ echo "No option config was found"
+ exit 1
+ fi
}
# Get a single argument