update nginx upgrade in install script

This commit is contained in:
VirtuBox
2019-04-04 15:53:45 +02:00
parent 606cd2c5bd
commit 3a6c3d9895
2 changed files with 10 additions and 8 deletions

View File

@@ -159,6 +159,7 @@ There is no need to be a developer or a system administrator to contribute to Wo
- Main source : [EasyEngine](https://github.com/easyengine/easyengine)
- Acme client : [Acme.sh](https://github.com/Neilpang/acme.sh)
- WordPress deployment : [WP-CLI](https://github.com/wp-cli/wp-cli)
- Monitoring : [Netdata](https://github.com/netdata/netdata)
## License

17
install
View File

@@ -7,7 +7,7 @@
# Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T
# -------------------------------------------------------------------------
# Version 3.9.5 - 2019-03-27
# Version 3.9.5 - 2019-04-03
# -------------------------------------------------------------------------
readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.4.3"
@@ -403,12 +403,13 @@ wo_upgrade_nginx() {
fi
# backup nginx conf
/usr/bin/rsync -az /etc/nginx/ /var/lib/wo-backup/nginx/
/usr/bin/rsync -az /etc/php/ /var/lib/wo-backup/php/
# chec if the package nginx-ee is installed
CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee)
CHECK_NGINX_WO=$(dpkg --list | grep nginx-wo)
CHECK_PHP72=$(dpkg --list | grep php7.2-fpm)
CHECK_PHP73=$(dpkg --list | grep php7.3-fpm)
CHECK_PHP72=$(command -v php-fpm7.2)
CHECK_PHP73=$(command -v php-fpm7.3)
# add new Nginx repository
if [ "$wo_linux_distro" = "Ubuntu" ]; then
@@ -447,25 +448,25 @@ wo_upgrade_nginx() {
# remove previous package
apt-mark unhold nginx-ee nginx-common nginx-custom
apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge
rm -rf /etc/nginx
elif [ -n "$CHECK_NGINX_WO" ]; then
apt-mark unhold nginx-wo nginx-common nginx-custom
apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge
fi
if [ -d /etc/nginx ]; then
rm -rf /etc/nginx
fi
# remove previous php-fpm pool configuration
if [ -n "$CHECK_PHP72" ]; then
apt-get remove php7.2-fpm -y -qq --purge
rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
fi
/usr/local/bin/wo stack install --nginx --php
echo "$wo_version_new" > /etc/nginx/common/release
if [ -n "$CHECK_PHP73" ]; then
apt-get remove php7.3-fpm -y -qq --purge
rm -f /etc/php/7.3/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
/usr/local/bin/wo stack install --php73
fi
/usr/local/bin/wo stack install --nginx --php --php73
echo "$wo_version_new" > /etc/nginx/common/release
rm -f /etc/nginx/common/acl.conf /etc/nginx/conf.d/{map-wp-cache.conf,map-wp.conf}
fi