aboutsummaryrefslogtreecommitdiff
path: root/share/keyringer/recipients
blob: 7048211fe9367dbf79129600560513f526c39e6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# Recipient management.
#

# Load functions
LIB="`dirname $0`/../../lib/keyringer"
source $LIB/functions
keyringer_set_env $*

# Aditional parameters
COMMAND="$2"

if [ -z "$COMMAND" ]; then
  echo "Usage: keyringer <keyring> `basename $0` <command> [arguments]"
  exit 1
elif [ ! -f "$RECIPIENTS" ]; then
  echo "No recipient config was found"
  exit 1
fi

if [ "$COMMAND" == "ls" ]; then
  cat $RECIPIENTS
elif [ "$COMMAND" == "edit" ]; then
  $EDITOR $RECIPIENTS
else
  echo "$BASENAME: No such command $COMMAND"
  exit 1
fi