fix TZ inheritance on install & init process

This commit is contained in:
a-sansara 2017-07-05 21:20:53 +02:00
parent 32093e01d6
commit 43ca75bef6
14 changed files with 31 additions and 7 deletions

Binary file not shown.

View File

@ -39,6 +39,7 @@ echo
tmpsed="/etc/php5/php.ini"
sed -ir 's/expose_php = On/expose_php = Off/' $tmpsed
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"
sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" $tmpsed
tmpsed="/etc/php5/php-fpm.conf"
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" $tmpsed

View File

@ -9,9 +9,9 @@ fi
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
tmpsed=/etc/apache2/httpd.conf
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' $tmpsed
sed -i 's#AllowOverride none#AllowOverride All#' $tmpsed
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php5/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php7/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

Binary file not shown.

View File

@ -9,9 +9,9 @@ fi
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
tmpsed=/etc/apache2/httpd.conf
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' "$tmpsed"
sed -i 's#AllowOverride none#AllowOverride All#' "$tmpsed"
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php5/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/bash
tmpsed="/etc/php7/php.ini"
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $tmpsed
cat $tmpsed | grep "date.timezone"

Binary file not shown.

View File

@ -5,7 +5,6 @@
if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo "$TZ" > /etc/TZ
cp "/usr/share/zoneinfo/$TZ" "/etc/localtime"
apk del tzdata
if [ ! "${TZ///*/}" = "$TZ" ]; then
mkdir -p "/usr/share/zoneinfo/${TZ///*/}"
fi
@ -13,6 +12,7 @@ if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo -e "\033[1;38;5;203mTIMEZONE : $TZ"
date
echo -en "\033[m"
apk del tzdata
else
echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE"
fi

View File

@ -0,0 +1,7 @@
#!/bin/bash
if [ "$TZ" != "Europe/Paris" ]; then
apk -U add tzdata
. /scripts/install.d/30-tz.sh
. /scripts/install.d/40-fix.sh
fi