summaryrefslogtreecommitdiff
path: root/share/keyringer/decrypt
diff options
context:
space:
mode:
Diffstat (limited to 'share/keyringer/decrypt')
-rwxr-xr-xshare/keyringer/decrypt23
1 files changed, 23 insertions, 0 deletions
diff --git a/share/keyringer/decrypt b/share/keyringer/decrypt
new file mode 100755
index 0000000..b933f3f
--- /dev/null
+++ b/share/keyringer/decrypt
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Decrypt files.
+#
+
+# Load functions
+LIB="`dirname $0`/../../lib/keyringer/functions"
+source $LIB
+
+BASEDIR="$1"
+FILE="`keyringer_filename $2`"
+KEYDIR="$BASEDIR/keys"
+BASENAME="`basename $0`"
+
+if [ -z "$FILE" ]; then
+ echo "Usage: `basename $0` <basedir> <file>"
+ exit 1
+elif [ ! -f "$KEYDIR/$FILE" ]; then
+ echo "File not found: $KEYDIR/$FILE"
+ exit 1
+fi
+
+gpg -d $KEYDIR/$FILE