memento-tergum/b2mount.sh
2020-04-08 15:09:44 -04:00

19 lines
479 B
Bash

#!/bin/bash
. /opt/b2backup/b2config.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