uci-docker-nextcloud/deploy/env_file

12 lines
392 B
Plaintext
Raw Permalink Normal View History

2024-09-12 16:21:59 -07:00
#!/bin/bash
env_file () {
env=${1:-.env}
[[ -f "${env}" ]] && { echo $env; return 0; } # || echo not $env
[[ -f "${env}.env" ]] && { echo "${env}.env"; return 0; } # || echo not ${env}.env
[[ -f "${env}/.env" ]] && { echo "${env}/.env"; return 0; } # || echo not ${env}/.env
return 1
}
# # if script was executed then call the function
(return 0 2>/dev/null) || env_file $@