Merge pull request #7574 from dokku/install-hostname-check

fix: do not write VHOST file if the DOKKU_ROOT directory does not exist
This commit is contained in:
Jose Diaz-Gonzalez
2025-03-08 21:35:58 -06:00
committed by GitHub

View File

@@ -2,8 +2,10 @@
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(hostname -f)") ]] && hostname -f >"$DOKKU_ROOT/VHOST"
if [[ ! -f "$DOKKU_ROOT/VHOST" ]] && [[ -n "$(dig +short "$(hostname -f)")" ]]; then
if [[ -d "$DOKKU_ROOT" ]] || [[ -L "$DOKKU_ROOT" ]]; then
hostname -f >"$DOKKU_ROOT/VHOST"
fi
fi
dokku_path="$(command -v dokku)"