#!/bin/bash
# A wrapper around gpg that makes gpg non-interactive, and makes it
# read a passphrase from the passphrase configuration file. To use
# this wrapper, prepend the containing directory to PATH.

set -e
if [[ "$1" == "--version" ]]; then
  exec /usr/bin/gpg2.real --version
else
  exec /usr/bin/gpg2.real --batch --passphrase-fd 3 "$@" 3<"/params/signing_passphrase"
fi
