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 -))
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"
# 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