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" tmpsed="/etc/php5/php.ini"
sed -ir 's/expose_php = On/expose_php = Off/' $tmpsed sed -ir 's/expose_php = On/expose_php = Off/' $tmpsed
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" $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 sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" $tmpsed
tmpsed="/etc/php5/php-fpm.conf" tmpsed="/etc/php5/php-fpm.conf"
sed -i "s|;*daemonize\s*=\s*yes|daemonize = no|g" $tmpsed 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 if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi fi
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' tmpsed=/etc/apache2/httpd.conf
sed -i "$tmpsed" /etc/apache2/httpd.conf sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' $tmpsed
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf sed -i 's#AllowOverride none#AllowOverride All#' $tmpsed
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR 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 if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
fi fi
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' tmpsed=/etc/apache2/httpd.conf
sed -i "$tmpsed" /etc/apache2/httpd.conf sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' "$tmpsed"
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf sed -i 's#AllowOverride none#AllowOverride All#' "$tmpsed"
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR 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 if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo "$TZ" > /etc/TZ echo "$TZ" > /etc/TZ
cp "/usr/share/zoneinfo/$TZ" "/etc/localtime" cp "/usr/share/zoneinfo/$TZ" "/etc/localtime"
apk del tzdata
if [ ! "${TZ///*/}" = "$TZ" ]; then if [ ! "${TZ///*/}" = "$TZ" ]; then
mkdir -p "/usr/share/zoneinfo/${TZ///*/}" mkdir -p "/usr/share/zoneinfo/${TZ///*/}"
fi fi
@ -13,6 +12,7 @@ if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo -e "\033[1;38;5;203mTIMEZONE : $TZ" echo -e "\033[1;38;5;203mTIMEZONE : $TZ"
date date
echo -en "\033[m" echo -en "\033[m"
apk del tzdata
else else
echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE" echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE"
fi 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