Current File : //scripts/settimezone.sh |
tz=$1
#echo "$TIMEZONE"
# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
echo "Mysql Time change start"
mysql -e "SET GLOBAL time_zone = '$tz' ";
echo "Mysql Time updated successfully"
echo "PHP Time change start"
sed -i "s#^\(date.timezone\).*#\date.timezone = $tz #" /etc/php.ini
sed -i "s#^\(date.timezone\).*#\date.timezone = $tz #" /etc/php54/php.ini
sed -i "s#^\(date.timezone\).*#\date.timezone = $tz #" /etc/php55/php.ini
sed -i "s#^\(date.timezone\).*#\date.timezone = $tz #" /etc/php56/php.ini
sed -i "s#^\(date.timezone\).*#\date.timezone = $tz #" /etc/php70/php.ini
echo "PHP Time change end"
echo "Server Time change start"
rm -fr /etc/localtime
cp /usr/share/zoneinfo/$tz /etc/localtime
echo "Server Time change End"
VER=`rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3`
if [[ "$VER" = "7" ]]; then
/bin/systemctl restart httpd.service
/bin/systemctl restart lighttpd.service
else
service httpd restart
service lighttpd restart
fi
#setso --set apache_changed true
#php /etc/sentora/panel/bin/daemon.php