update nginx upgrade in install script
This commit is contained in:
@@ -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)
|
- Main source : [EasyEngine](https://github.com/easyengine/easyengine)
|
||||||
- Acme client : [Acme.sh](https://github.com/Neilpang/acme.sh)
|
- Acme client : [Acme.sh](https://github.com/Neilpang/acme.sh)
|
||||||
- WordPress deployment : [WP-CLI](https://github.com/wp-cli/wp-cli)
|
- WordPress deployment : [WP-CLI](https://github.com/wp-cli/wp-cli)
|
||||||
|
- Monitoring : [Netdata](https://github.com/netdata/netdata)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
17
install
17
install
@@ -7,7 +7,7 @@
|
|||||||
# Copyright (c) 2019 - WordOps
|
# Copyright (c) 2019 - WordOps
|
||||||
# This script is licensed under M.I.T
|
# 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_old="2.2.3"
|
||||||
readonly wo_version_new="3.9.4.3"
|
readonly wo_version_new="3.9.4.3"
|
||||||
@@ -403,12 +403,13 @@ wo_upgrade_nginx() {
|
|||||||
fi
|
fi
|
||||||
# backup nginx conf
|
# backup nginx conf
|
||||||
/usr/bin/rsync -az /etc/nginx/ /var/lib/wo-backup/nginx/
|
/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
|
# chec if the package nginx-ee is installed
|
||||||
CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee)
|
CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee)
|
||||||
CHECK_NGINX_WO=$(dpkg --list | grep nginx-wo)
|
CHECK_NGINX_WO=$(dpkg --list | grep nginx-wo)
|
||||||
CHECK_PHP72=$(dpkg --list | grep php7.2-fpm)
|
CHECK_PHP72=$(command -v php-fpm7.2)
|
||||||
CHECK_PHP73=$(dpkg --list | grep php7.3-fpm)
|
CHECK_PHP73=$(command -v php-fpm7.3)
|
||||||
|
|
||||||
# add new Nginx repository
|
# add new Nginx repository
|
||||||
if [ "$wo_linux_distro" = "Ubuntu" ]; then
|
if [ "$wo_linux_distro" = "Ubuntu" ]; then
|
||||||
@@ -447,25 +448,25 @@ wo_upgrade_nginx() {
|
|||||||
# remove previous package
|
# remove previous package
|
||||||
apt-mark unhold nginx-ee nginx-common nginx-custom
|
apt-mark unhold nginx-ee nginx-common nginx-custom
|
||||||
apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge
|
apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge
|
||||||
rm -rf /etc/nginx
|
|
||||||
elif [ -n "$CHECK_NGINX_WO" ]; then
|
elif [ -n "$CHECK_NGINX_WO" ]; then
|
||||||
apt-mark unhold nginx-wo nginx-common nginx-custom
|
apt-mark unhold nginx-wo nginx-common nginx-custom
|
||||||
apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge
|
apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge
|
||||||
|
|
||||||
|
fi
|
||||||
|
if [ -d /etc/nginx ]; then
|
||||||
rm -rf /etc/nginx
|
rm -rf /etc/nginx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove previous php-fpm pool configuration
|
# remove previous php-fpm pool configuration
|
||||||
if [ -n "$CHECK_PHP72" ]; then
|
if [ -n "$CHECK_PHP72" ]; then
|
||||||
apt-get remove php7.2-fpm -y -qq --purge
|
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}
|
rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
|
||||||
fi
|
fi
|
||||||
/usr/local/bin/wo stack install --nginx --php
|
|
||||||
echo "$wo_version_new" > /etc/nginx/common/release
|
|
||||||
if [ -n "$CHECK_PHP73" ]; then
|
if [ -n "$CHECK_PHP73" ]; then
|
||||||
apt-get remove php7.3-fpm -y -qq --purge
|
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}
|
rm -f /etc/php/7.3/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
|
||||||
/usr/local/bin/wo stack install --php73
|
|
||||||
fi
|
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}
|
rm -f /etc/nginx/common/acl.conf /etc/nginx/conf.d/{map-wp-cache.conf,map-wp.conf}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user