Merge pull request #2928 from silverfix/patch-1

fix: do not overwrite the VHOST file during installation if it exists
This commit is contained in:
Jose Diaz-Gonzalez
2017-10-05 22:32:58 -04:00
committed by GitHub

16
debian/postinst vendored
View File

@@ -100,12 +100,18 @@ case "$1" in
exit 0 exit 0
fi fi
db_get "dokku/vhost_enable" if [ -f "${DOKKU_ROOT}/VHOST" ]; then
if [ "$RET" = "true" ]; then echo "VHOST file detected, skipping modification"
db_get "dokku/hostname"
echo "$RET" > "${DOKKU_ROOT}/VHOST"
else else
rm -f "${DOKKU_ROOT}/VHOST" db_get "dokku/vhost_enable"
if [ "$RET" = "true" ]; then
db_get "dokku/hostname"
echo "Setting VHOST contents to $RET"
echo "$RET" > "${DOKKU_ROOT}/VHOST"
else
echo "VHOST disabled via debconf, removing"
rm -f "${DOKKU_ROOT}/VHOST"
fi
fi fi
db_get "dokku/hostname" db_get "dokku/hostname"