aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/keyringer/append13
l---------share/keyringer/append-batch1
-rwxr-xr-xshare/keyringer/encrypt7
l---------share/keyringer/encrypt-batch1
4 files changed, 16 insertions, 6 deletions
diff --git a/share/keyringer/append b/share/keyringer/append
index 436b1ca..81300e0 100755
--- a/share/keyringer/append
+++ b/share/keyringer/append
@@ -15,10 +15,13 @@ IFS=$'\n'
CONTENT=($(keyringer_exec decrypt $BASEDIR $FILE))
-echo " "
-echo "$FILE currently has ${#CONTENT[@]} lines"
-echo " "
-echo "Now please write the content to be appended on $FILE, finnishing with Ctrl-D:"
+if [ "$1" = "append" ]; then
+ # only display directions if we're running append, not append-batch
+ echo " "
+ echo "$FILE currently has ${#CONTENT[@]} lines"
+ echo " "
+ echo "Now please write the content to be appended on $FILE, finnishing with Ctrl-D:"
+fi
APPEND=($(cat -))
@@ -26,6 +29,6 @@ NEW=( ${CONTENT[@]} ${APPEND[@]} )
for element in $(seq 0 $((${#NEW[@]} - 1))); do
echo ${NEW[$element]}
-done | keyringer_exec encrypt $BASEDIR $FILE
+done | keyringer_exec encrypt-batch $BASEDIR $FILE
IFS="$OLDIFS"
diff --git a/share/keyringer/append-batch b/share/keyringer/append-batch
new file mode 120000
index 0000000..6b140f7
--- /dev/null
+++ b/share/keyringer/append-batch
@@ -0,0 +1 @@
+append \ No newline at end of file
diff --git a/share/keyringer/encrypt b/share/keyringer/encrypt
index ac2a43e..14ee707 100755
--- a/share/keyringer/encrypt
+++ b/share/keyringer/encrypt
@@ -12,7 +12,12 @@ keyringer_get_new_file $2
# Encrypt
mkdir -p $KEYDIR/`dirname $FILE`
-echo "Type your message and finish your input with EOF (Ctrl-D)."
+
+if [ "$1" = "encrypt" ]; then
+ # only display directions if we're running encrypt, not encrypt-batch
+ echo "Type your message and finish your input with EOF (Ctrl-D)."
+fi
+
gpg --use-agent --armor -e -s $(keyringer_recipients $RECIPIENTS) - > $KEYDIR/$FILE
# Stage
diff --git a/share/keyringer/encrypt-batch b/share/keyringer/encrypt-batch
new file mode 120000
index 0000000..8267197
--- /dev/null
+++ b/share/keyringer/encrypt-batch
@@ -0,0 +1 @@
+encrypt \ No newline at end of file