diff --git a/src/init.sh b/src/init.sh index 0ffab31..594554e 100755 --- a/src/init.sh +++ b/src/init.sh @@ -2,8 +2,9 @@ set -e -# if RCLONE_CONFIG_CONTENT is empty and no config file was found -if [ -z "$RCLONE_CONFIG_CONTENT" ] && [ ! -e "${RCLONE_CONFIG:=/config/rclone.conf}" ]; then +if [ -n "$RCLONE_CONFIG_CONTENT" ]; then + echo "$RCLONE_CONFIG_CONTENT" > "${RCLONE_CONFIG:=/config/rclone.conf}" +elif [ ! -e "${RCLONE_CONFIG:=/config/rclone.conf}" ]; then echo "No rclone config found" rclone --config "${RCLONE_CONFIG:=/config/rclone.conf}" config fi