set clear_env => no

enables $_ENV[] can be used without hack sed replace
This commit is contained in:
Jack McNicol
2016-07-22 02:43:37 +09:30
parent e741466e76
commit a90c60009c
2 changed files with 2 additions and 14 deletions

View File

@@ -71,19 +71,6 @@ if [ ! -z "$PHP_UPLOAD_MAX_FILESIZE" ]; then
sed -i "s/upload_max_filesize = 100M/upload_max_filesize= ${PHP_UPLOAD_MAX_FILESIZE}M/g" /etc/php5/conf.d/php.ini
fi
# Very dirty hack to replace variables in code with ENVIRONMENT values
if [[ "$TEMPLATE_NGINX_HTML" == "1" ]] ; then
for i in $(env)
do
variable=$(echo "$i" | cut -d'=' -f1)
value=$(echo "$i" | cut -d'=' -f2)
if [[ "$variable" != '%s' ]] ; then
replace='\$\$_'${variable}'_\$\$'
find /var/www/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \;
fi
done
fi
# Always chown webroot for better mounting
chown -Rf nginx.nginx $webroot