Files
docker-backup-gpg-s3/restore.sh

23 lines
420 B
Bash

#!/bin/sh
gpg --import /keys/*
AWS_ENDPOINT_OPTION=
if [ "$AWS_USE_MINIO" -eq 1 ] ; then
aws configure set default.s3.signature_version s3v4
AWS_ENDPOINT_OPTION="--endpoint-url https://${MINIO_ENDPOINT}"
fi
cd /restore
aws ${AWS_ENDPOINT_OPTION} s3 cp s3://$S3_BUCKET_NAME/$RESTORE_FILE .
gpg --output ./restore.tar.xz --decrypt $RESTORE_FILE
tar xf ./restore.tar.xz
rm restore.tar.xz
rm $RESTORE_FILE
exit