ansible-taler-exchange

Ansible playbook to deploy a production Taler Exchange
Log | Files | Refs | README | LICENSE

encrypt (490B)


      1 #!/usr/bin/env bash
      2 
      3 # Helper script to encrypt a file in
      4 # the repository.
      5 # Makes sure that the output file is ignored in git.
      6 
      7 set -eu
      8 
      9 if [[ -z ${1:-} ]]; then
     10   echo "Usage: $0 FILE" >&2
     11   exit 1
     12 fi
     13 
     14 if ! git check-ignore "$1" >/dev/null; then
     15   echo "Input file must be gitignored" >&2
     16   exit 1
     17 fi
     18 
     19 tmpfile=$(mktemp "$1.gpg.XXXXXX")
     20 trap 'rm -f "$tmpfile"' EXIT
     21 
     22 gpg --encrypt \
     23   --recipient grothoff@gnunet.org \
     24   --recipient me@fdold.eu < "$1" > "$tmpfile"
     25 mv "$tmpfile" "$1.gpg"