summaryrefslogtreecommitdiff
path: root/share/keyringer/decrypt
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:40:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-18 12:40:56 -0300
commit4d85c40d8ac5140835c5f75d513f886ae5910da9 (patch)
treefb26d4de4ed2f4ea40f1cd259d5a70baba07469a /share/keyringer/decrypt
parent8d8ceaebb92cb5036c81cc39f711ce72bb942a8d (diff)
downloadkeyringer-4d85c40d8ac5140835c5f75d513f886ae5910da9.tar.gz
keyringer-4d85c40d8ac5140835c5f75d513f886ae5910da9.tar.bz2
Making code that checks for file argument as a common function
Diffstat (limited to 'share/keyringer/decrypt')
-rwxr-xr-xshare/keyringer/decrypt12
1 files changed, 2 insertions, 10 deletions
diff --git a/share/keyringer/decrypt b/share/keyringer/decrypt
index cb1d35b..71367f5 100755
--- a/share/keyringer/decrypt
+++ b/share/keyringer/decrypt
@@ -8,15 +8,7 @@ LIB="`dirname $0`/../../lib/keyringer/functions"
source $LIB
keyringer_set_env $*
-# Aditional parameters
-FILE="`keyringer_filename $2`"
-
-if [ -z "$FILE" ]; then
- echo "Usage: keyringer <keyring> `basename $0` <file>"
- exit 1
-elif [ ! -f "$KEYDIR/$FILE" ]; then
- echo "File not found: $KEYDIR/$FILE"
- exit 1
-fi
+# Get file
+keyringer_get_file $2
gpg --quiet --use-agent -d $KEYDIR/$FILE