From c353f456121f87c6d97eb2701a44be3faedb07fd Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 14 Dec 2019 22:03:12 +0000 Subject: [PATCH] GPG passphrase must be an environment variable --- b2-backup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/b2-backup.sh b/b2-backup.sh index 9e32300..d5ea65d 100755 --- a/b2-backup.sh +++ b/b2-backup.sh @@ -1,7 +1,10 @@ -#!/bin/sh +#!/bin/bash + +set -ue # Import all account and GPG variables source ./b2.cred +export PASSPHRASE=${GPG_PASSPHRASE} # Local directory to backup LOCAL_DIR="/media/usb0/backup" @@ -20,3 +23,6 @@ duplicity cleanup --force \ duplicity collection-status \ --encrypt-sign-key $GPG_KEY \ b2://${B2_ACCOUNT}:${B2_KEY}@${B2_BUCKET} + +# Unset the GPG passphrase +unset PASSPHRASE