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