From 56012d8719db1c783dbca01609123fa7e634540c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 24 Oct 2015 16:48:35 +0300 Subject: [PATCH] smart way to hanlde php.ini --- install/vst-install-debian.sh | 9 +++++---- install/vst-install-rhel.sh | 6 ++++-- install/vst-install-ubuntu.sh | 9 +++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 36e619714..b740e6c09 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -105,6 +105,7 @@ set_default_value() { fi } + #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# @@ -853,10 +854,10 @@ ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}') if [ -z "$ZONE" ]; then ZONE='UTC' fi -sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/apache2/php.ini -sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/cli/php.ini -sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/apache2/php.ini -sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/cli/php.ini +for pconf in $(find /etc/php* -name php.ini); do + sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf + sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf +fi #----------------------------------------------------------# diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 53c6912d4..470c45ad2 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -892,8 +892,10 @@ fi if [ -z "$ZONE" ]; then ZONE='UTC' fi -sed -i 's%short_open_tag = Off%short_open_tag = On%g' /etc/php.ini -sed -i "s%;date.timezone =%date.timezone = $ZONE%g" /etc/php.ini +for pconf in $(find /etc/php* -name php.ini); do + sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf + sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf +fi #----------------------------------------------------------# diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 0aeb8878b..6847da629 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -90,6 +90,7 @@ set_default_value() { fi } + #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# @@ -845,10 +846,10 @@ ZONE=$(timedatectl 2>/dev/null|grep Timezone|awk '{print $2}') if [ -z "$ZONE" ]; then ZONE='UTC' fi -sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/apache2/php.ini -sed -i "s/;date.timezone =/date.timezone = $ZONE/g" /etc/php5/cli/php.ini -sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/apache2/php.ini -sed -i 's%_open_tag = Off%_open_tag = On%g' /etc/php5/cli/php.ini +for pconf in $(find /etc/php* -name php.ini); do + sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf + sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf +fi #----------------------------------------------------------#