fixed empty var check
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build encountered an error

This commit is contained in:
Niklas 2021-07-02 20:02:42 +02:00
parent b18ba2cbc5
commit 82a5e5b2ab
2 changed files with 6 additions and 6 deletions

View File

@ -5,17 +5,17 @@ set -e
[ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1 [ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG 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}" RESTIC_PASSWORD="${ENC_PASSWORD}"
elif [ -z "${ENC_PASSWORD_FILE}" ]; then elif [ -n "${ENC_PASSWORD_FILE}" ]; then
RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE") RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE")
else else
echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1 echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1
fi fi
if [ -z "${MYSQL_PASSWORD}" ]; then if [ -n "${MYSQL_PASSWORD}" ]; then
MYSQL_PASSWORD_ACTUAL="${MYSQL_PASSWORD}" MYSQL_PASSWORD_ACTUAL="${MYSQL_PASSWORD}"
elif [ -z "${MYSQL_PASSWORD_FILE}" ]; then elif [ -n "${MYSQL_PASSWORD_FILE}" ]; then
MYSQL_PASSWORD_ACTUAL=$(cat "$MYSQL_PASSWORD_FILE") MYSQL_PASSWORD_ACTUAL=$(cat "$MYSQL_PASSWORD_FILE")
fi fi

View File

@ -5,9 +5,9 @@ set -e
[ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1 [ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG 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}" RESTIC_PASSWORD="${ENC_PASSWORD}"
elif [ -z "${ENC_PASSWORD_FILE}" ]; then elif [ -n "${ENC_PASSWORD_FILE}" ]; then
RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE") RESTIC_PASSWORD=$(cat "$ENC_PASSWORD_FILE")
else else
echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1 echo "\$ENC_PASSWORD or \$ENC_PASSWORD_FILE is not set" && exit 1