#!/bin/bash
. ${PWD}/config.txt

export B2_ACCOUNT_ID="$B2_ACCOUNT_ID"
export B2_ACCOUNT_KEY="$B2_ACCOUNT_KEY"
export RESTIC_REPOSITORY="$RESTIC_REPOSITORY"
export RESTIC_PASSWORD_FILE="$RESTIC_PASSWORD_FILE"
RESTOREDIR="$RESTORE_DIR"

mkdir -p $RESTOREDIR
/usr/bin/restic mount $RESTOREDIR &
echo "Backups mounted to $RESTOREDIR"
echo ""
echo "Run umount $RESTOREDIR when finished"
echo ""

for var in $(awk -F"=" '{print $1}' ${PWD}/config.txt); do
    unset $var
done