diff --git a/.travis.yml b/.travis.yml index e1898ba..b554dfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: - sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig' - sudo echo "Travis Banch = $TRAVIS_BRANCH" - sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt ccze tree - - sudo bash install $TRAVIS_BRANCH + - sudo bash wo.sh $TRAVIS_BRANCH - sudo wo --help - sudo wo site create wp-php73.net --wp --php73 || sudo tail -n50 /var/log/wo/wordops.log diff --git a/install b/install index 732770b..a5d3b41 100644 --- a/install +++ b/install @@ -402,9 +402,12 @@ wo_upgrade_nginx() { rm -rf /var/lib/wo-backup/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/ - + if [ -d /etc/nginx ]; then + /usr/bin/rsync -az /etc/nginx/ /var/lib/wo-backup/nginx/ + fi + if [ -d /etc/php ]; then + /usr/bin/rsync -az /etc/php/ /var/lib/wo-backup/php/ + fi # chec if the package nginx-ee is installed CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee) CHECK_NGINX_WO=$(dpkg --list | grep nginx-wo) @@ -462,10 +465,13 @@ wo_upgrade_nginx() { rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf} fi if [ -n "$CHECK_PHP73" ]; then + WO_STACK_INSTALL_ARGS="--php73" 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} + else + WO WO_STACK_INSTALL_ARGS="" fi - /usr/local/bin/wo stack install --nginx --php --php73 + /usr/local/bin/wo stack install --nginx --php $WO_STACK_INSTALL_ARGS 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 @@ -693,13 +699,14 @@ if [ "$migration" -eq "1" ]; then wo_lib_echo_info "For autocompletion, run the following command:" wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc" echo - wo_lib_echo "WordOps (wo) help: https://docs.wordops.net" -else + wo_lib_echo "WordOps Documentation : https://docs.wordops.net" + wo_lib_echo "WordOps Community Forum : https://community.wordops.net" echo wo_lib_echo "For WordOps (wo) auto completion, run the following command" echo wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc" echo wo_lib_echo "Yay! WordOps (wo) installed/updated successfully" - wo_lib_echo "WordOps (wo) help: https://docs.wordops.net" + wo_lib_echo "WordOps Documentation : https://docs.wordops.net" + wo_lib_echo "WordOps Community Forum : https://community.wordops.net" fi diff --git a/wo.sh b/wo.sh new file mode 100644 index 0000000..8160bac --- /dev/null +++ b/wo.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# ------------------------------------------------------------------------- +# WordOps install script downloader +# ------------------------------------------------------------------------- +# Website: https://wordops.net +# GitHub: https://github.com/WordOps/WordOps +# Copyright (c) 2019 - WordOps +# This script is licensed under M.I.T +# ------------------------------------------------------------------------- +# Version 3.9.5 - 2019-04-10 +# ------------------------------------------------------------------------- + +### +# 1 - Check whether the installation is called with elevated rights +### +if [[ $EUID -ne 0 ]]; then + wo_lib_echo_fail "Sudo privilege required..." + wo_lib_echo_fail "Use: wget -qO wo wops.cc && sudo bash wo" + exit 100 +fi + +[ -z "$(command -v git)" ] && { + apt-get update -qq && apt-get install git -qq +} > /dev/null 2>&1 + +# update or clone wordops repositoru +if [ -d /tmp/WordOps/.git ]; then + git -C /tmp/WordOps pull origin master -q +else + rm -rf /tmp/WordOps + git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$@" -q +fi + +if [ -x /tmp/WordOps/install ]; then +/tmp/WordOps/install "$@" +fi