redis/root/usr/share/container-scripts/redis/validate-variables.sh
2021-09-16 12:42:22 +00:00

15 lines
409 B
Bash

function usage() {
[ $# == 1 ] && echo "error: $1"
echo "You can specify the following environment variables:"
echo " REDIS_PASSWORD (regex: '$redis_password_regex')"
exit 1
}
function validate_variables() {
# Check basic sanity of specified variables
if [[ -v REDIS_PASSWORD ]]; then
[[ "$REDIS_PASSWORD" =~ $redis_password_regex ]] || usage "Invalid password"
fi
}
validate_variables