From 82a5e5b2ab24f380ac81834d369f58d2f530aafa Mon Sep 17 00:00:00 2001 From: Niklas Date: Fri, 2 Jul 2021 20:02:42 +0200 Subject: [PATCH] fixed empty var check --- entrypoint.sh | 8 ++++---- init.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6452c3e..4d21945 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,17 +5,17 @@ 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 +if [ -n "${ENC_PASSWORD}" ]; then RESTIC_PASSWORD="${ENC_PASSWORD}" -elif [ -z "${ENC_PASSWORD_FILE}" ]; then +elif [ -n "${ENC_PASSWORD_FILE}" ]; then RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE") else echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1 fi -if [ -z "${MYSQL_PASSWORD}" ]; then +if [ -n "${MYSQL_PASSWORD}" ]; then MYSQL_PASSWORD_ACTUAL="${MYSQL_PASSWORD}" -elif [ -z "${MYSQL_PASSWORD_FILE}" ]; then +elif [ -n "${MYSQL_PASSWORD_FILE}" ]; then MYSQL_PASSWORD_ACTUAL=$(cat "$MYSQL_PASSWORD_FILE") fi diff --git a/init.sh b/init.sh index 0663fa1..c1abc4f 100755 --- a/init.sh +++ b/init.sh @@ -5,9 +5,9 @@ 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 +if [ -n "${ENC_PASSWORD}" ]; then RESTIC_PASSWORD="${ENC_PASSWORD}" -elif [ -z "${ENC_PASSWORD_FILE}" ]; then +elif [ -n "${ENC_PASSWORD_FILE}" ]; then RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE") else echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1