22 lines
507 B
Bash
Executable File
22 lines
507 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
[ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1
|
|
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG is not set" && exit 1
|
|
|
|
if [ -z "${ENC_PASSWORD}" ]
|
|
then
|
|
RESTIC_PASSWORD="${ENC_PASSWORD}"
|
|
else if [ -z "${ENC_PASSWORD_FILE}" ]
|
|
RESTIC_PASSWORD=$(cat $ENC_PASSWORD_FILE)
|
|
else
|
|
echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1
|
|
fi
|
|
|
|
echo "Init new repo"
|
|
|
|
restic -r "rclone:$RCLONE_REMOTE" init
|
|
|
|
echo "Created new repo at $RCLONE_REMOTE"
|