diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-02-27 11:25:28 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-02-27 11:25:28 -0300 |
commit | e6d3f3e0c5671ff853404a962d856ec493b8dbdb (patch) | |
tree | 61959b54f3b2ac214de733472f77bf8872bd1c2b /share/keyringer/recipients | |
parent | 8fa3ddbc6cdf5adb3414c782ff83c371b17d38d8 (diff) | |
download | keyringer-e6d3f3e0c5671ff853404a962d856ec493b8dbdb.tar.gz keyringer-e6d3f3e0c5671ff853404a962d856ec493b8dbdb.tar.bz2 |
Multiple recipients file support
Diffstat (limited to 'share/keyringer/recipients')
-rwxr-xr-x | share/keyringer/recipients | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/share/keyringer/recipients b/share/keyringer/recipients index 2fe2ddf..ab61bd7 100755 --- a/share/keyringer/recipients +++ b/share/keyringer/recipients @@ -10,11 +10,36 @@ source "$LIB/functions" || exit 1 # Command parser keyringer_get_command "$2" +# Set recipients file +keyringer_set_new_recipients "$3" + if [ "$COMMAND" == "ls" ]; then - cat "$RECIPIENTS" + if [ ! -z "$3" ]; then + if [ -e "$RECIPIENTS_FILE" ]; then + cat "$RECIPIENTS_FILE" + else + echo "Recipients file not found: $RECIPIENTS_FILE_BASE" + exit 1 + fi + else + for recipients in `ls $RECIPIENTS`; do + echo "In recipients file $recipients:" + echo "-----------------------------------------------------------------------------------" + cat $RECIPIENTS/$recipients + echo "" + done + fi elif [ "$COMMAND" == "edit" ]; then - "$EDITOR" "$RECIPIENTS" - keyringer_check_recipients + if [ ! -z "$3" ]; then + keyringer_create_new_recipients $RECIPIENTS_FILE + "$EDITOR" "$RECIPIENTS_FILE" + keyringer_check_recipients + keyringer_exec git "$BASEDIR" add "$RECIPIENTS_FILE_BASE" + else + echo "Please specify one recipient to edit among the available:" + ls $RECIPIENTS | sed -e 's/^/\t/' + exit 1 + fi else printf "%s: No such command %s\n" "$BASENAME" "$COMMAND" exit 1 |