updates for being contained in a subdir

This commit is contained in:
John Lancaster
2024-05-20 19:02:24 -05:00
parent 330ae34cc0
commit d69d7caf2a
2 changed files with 18 additions and 27 deletions

View File

@@ -3,11 +3,27 @@
set -e
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
DATA_DIR=$SCRIPT_DIR/data
REPO_DIR=$(dirname $SCRIPT_DIR)
ENV_FILE=$SCRIPT_DIR/.env
ENV_FILE=$REPO_DIR/.env
echo "Reading env variables from $ENV_FILE"
source $ENV_FILE
if [ -z "$DATA_DIR" ]; then
echo "Error: DATA_DIR is not set."
exit 1
fi
if [ -z "$RESTIC_REPOSITORY" ]; then
echo "Error: RESTIC_REPOSITORY is not set."
exit 1
fi
if [ -z "$RESTIC_PASSWORD" ]; then
echo "Error: RESTIC_PASSWORD is not set."
exit 1
fi
docker run -it --rm \
--hostname $HOSTNAME \
--env-file $ENV_FILE \