aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-14 10:55:19 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-14 10:55:19 -0300
commit3f7f4aa86309ebc44e1097158ec33abda3465945 (patch)
tree8a3dfbf5c29b9d97baefb767b0bc25e788e836b5
parent15fbe5a432a361cc9c7a628aaae7c041263d3086 (diff)
downloadkeyringer-3f7f4aa86309ebc44e1097158ec33abda3465945.tar.gz
keyringer-3f7f4aa86309ebc44e1097158ec33abda3465945.tar.bz2
Basic checks
-rwxr-xr-xkeyringer12
1 files changed, 6 insertions, 6 deletions
diff --git a/keyringer b/keyringer
index 161ab5e..0ec90be 100755
--- a/keyringer
+++ b/keyringer
@@ -177,8 +177,11 @@ fi
# Load functions
source "$LIB" || exit 1
-# Check if keyring exists
-if [ ! -f "$CONFIG_BASE/$KEYRING" ] && [ "$ACTION" != "init" ]; then
+# Basic checks
+if [ -z "$KEYRING" ]; then
+ keyringer_usage
+ exit 1
+elif [ ! -f "$CONFIG_BASE/$KEYRING" ] && [ "$ACTION" != "init" ]; then
echo "No such keyring $KEYRING"
exit 1
fi
@@ -187,10 +190,7 @@ fi
keyringer_config_load
# Dispatch
-if [ -z "$KEYRING" ]; then
- keyringer_usage
- exit 1
-elif [ -z "$ACTION" ]; then
+if [ -z "$ACTION" ]; then
# Run shell if no action were given
keyringer $KEYRING shell
elif [ "$ACTION" == "init" ]; then