2022-12-06 20:40:47 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# Exit on error. For debug use set -x
|
|
|
|
set -e
|
|
|
|
|
2024-01-20 16:00:11 +01:00
|
|
|
if [ -n "${RESTIC_REPO_PASSWORD}" ]; then
|
|
|
|
echo "The environment variable RESTIC_REPO_PASSWORD is deprecated, please use RESTIC_PASSWORD instead."
|
|
|
|
export RESTIC_PASSWORD="${RESTIC_REPO_PASSWORD}"
|
|
|
|
fi
|
|
|
|
if [ -n "${RESTIC_REPO_PASSWORD_FILE}" ]; then
|
|
|
|
echo "The environment variable RESTIC_REPO_PASSWORD_FILE is deprecated, please use RESTIC_PASSWORD_FILE instead."
|
|
|
|
export RESTIC_PASSWORD_FILE="${RESTIC_REPO_PASSWORD_FILE}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${RESTIC_PASSWORD}" ]; then
|
|
|
|
if [ -z "${RESTIC_PASSWORD_FILE}" ]; then
|
|
|
|
echo "You have to define one of these environment variables: RESTIC_PASSWORD or RESTIC_PASSWORD_FILE"
|
2023-02-02 19:25:34 +01:00
|
|
|
exit 1
|
2022-12-06 20:40:47 +01:00
|
|
|
fi
|
|
|
|
else
|
2024-01-20 16:00:11 +01:00
|
|
|
export RESTIC_PASSWORD_FILE="/tmp/restic_passwd"
|
|
|
|
echo "${RESTIC_PASSWORD}" > "${RESTIC_PASSWORD_FILE}"
|
2022-12-06 20:40:47 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
/usr/local/bin/python -u /restic-exporter.py
|