aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie McClelland <jm@mayfirst.org>2010-09-19 12:44:11 -0400
committerJamie McClelland <jm@mayfirst.org>2010-09-19 12:44:11 -0400
commitab583a9e2a2e0f8452016cfc968339d638da40b4 (patch)
tree644cf05b4b5f50a38be9ccb032c411df80153eb8
parentb5b18cd53354b838fc4ea42fedf88167d443aafe (diff)
downloadkeyringer-ab583a9e2a2e0f8452016cfc968339d638da40b4.tar.gz
keyringer-ab583a9e2a2e0f8452016cfc968339d638da40b4.tar.bz2
adding new commands append-batch and encrypt-batch, which reduce
the verbosity of the messages being displayed.
-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