summaryrefslogtreecommitdiff
path: root/gpg/gpg2.sh
blob: 1292b7095d41f001ca90302e1bf1f2f1c9263208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

if [ -z "$1" ]; then
  echo "Usage: $0 <environment> [ .. additional parameters passwd on to gpg2 .. ]"
  exit 1
fi
NAME="$1"
shift

BIN=$(which gpg2)
if [ $? -ne 0 ]; then
  BIN=$(which gpg)
fi

exec $BIN --keyring "${BASH_SOURCE%/*}/vault-keyring-$NAME.gpg" --secret-keyring /dev/null --no-options --no-default-keyring --trust-model always --keyid-format 0xlong "$@"