aboutsummaryrefslogtreecommitdiff
path: root/share/keyringer/append
diff options
context:
space:
mode:
Diffstat (limited to 'share/keyringer/append')
-rwxr-xr-xshare/keyringer/append13
1 files changed, 8 insertions, 5 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"