fixed empty var check
This commit is contained in:
parent
b18ba2cbc5
commit
82a5e5b2ab
@ -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
|
||||||
|
|
||||||
|
4
init.sh
4
init.sh
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user