Closed agoncharov-reef closed 3 years ago
When not having EMAIL_TARGET env var set, running
EMAIL_TARGET
if [ -n "${EMAIL_HOST}" ] && [ -n "${EMAIL_TARGET}" ]; then
fails with:
bin/backup-db.sh: line 36: EMAIL_TARGET: unbound variable
One possible solution is to change #!/bin/bash -eu to #!/bin/bash -e, or do more advanced check for undefined variables.
#!/bin/bash -eu
#!/bin/bash -e
if [ -n "${EMAIL_HOST:-}" ] && [ -n "${EMAIL_TARGET:-}" ]; then
When not having
EMAIL_TARGET
env var set, runningfails with:
One possible solution is to change
#!/bin/bash -eu
to#!/bin/bash -e
, or do more advanced check for undefined variables.