add wo.sh downloader

This commit is contained in:
VirtuBox
2019-04-10 16:09:25 +02:00
parent 2bc216d817
commit dc27235220
3 changed files with 51 additions and 8 deletions

View File

@@ -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

21
install
View File

@@ -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

36
wo.sh Normal file
View File

@@ -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