fix installer in case of manual install
This commit is contained in:
31
install
31
install
@@ -56,7 +56,7 @@ wo_lib_error() {
|
|||||||
###
|
###
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
wo_lib_echo_fail "Sudo privilege required..."
|
wo_lib_echo_fail "Sudo privilege required..."
|
||||||
wo_lib_echo_fail "Use: wget -qO wo wordops.se/tup && sudo bash wo"
|
wo_lib_echo_fail "Use: curl -sL wops.cc | sudo bash"
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -81,6 +81,11 @@ fi
|
|||||||
###
|
###
|
||||||
# 1 - Define variables for later use
|
# 1 - Define variables for later use
|
||||||
###
|
###
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
wo_branch=master
|
||||||
|
else
|
||||||
|
wo_branch="$1"
|
||||||
|
fi
|
||||||
readonly wo_log_dir=/var/log/wo/
|
readonly wo_log_dir=/var/log/wo/
|
||||||
readonly wo_backup_dir=/var/lib/wo-backup/
|
readonly wo_backup_dir=/var/lib/wo-backup/
|
||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
@@ -227,8 +232,8 @@ wo_sync_db() {
|
|||||||
|
|
||||||
wo_site_current_type=$(grep "common/" /etc/nginx/sites-available/$site | awk -F "/" '{print $2}')
|
wo_site_current_type=$(grep "common/" /etc/nginx/sites-available/$site | awk -F "/" '{print $2}')
|
||||||
|
|
||||||
if [ "$(echo "$wo_site_current_type" | grep php)" ]; then
|
if [ "$(echo $wo_site_current_type | grep php)" ]; then
|
||||||
if [ "$(echo "$wo_site_current_type" | grep php7)" ]; then
|
if [ "$(echo $wo_site_current_type | grep php7)" ]; then
|
||||||
wo_php_version="7.0"
|
wo_php_version="7.0"
|
||||||
else
|
else
|
||||||
wo_php_version="5.6"
|
wo_php_version="5.6"
|
||||||
@@ -237,28 +242,28 @@ wo_sync_db() {
|
|||||||
wo_php_version=""
|
wo_php_version=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(echo "$wo_site_current_type" | grep redis)" ]; then
|
if [ "$(echo $wo_site_current_type | grep redis)" ]; then
|
||||||
wo_site_current_cache="wpredis"
|
wo_site_current_cache="wpredis"
|
||||||
elif [ -z "$(echo "$wo_site_current_type" | grep wpsc)" ]; then
|
elif [ -z "$(echo $wo_site_current_type | grep wpsc)" ]; then
|
||||||
wo_site_current_cache="wpsc"
|
wo_site_current_cache="wpsc"
|
||||||
elif [ -z "$(echo "$wo_site_current_type" | grep wpfc)" ]; then
|
elif [ -z "$(echo $wo_site_current_type | grep wpfc)" ]; then
|
||||||
wo_site_current_cache="wpfc"
|
wo_site_current_cache="wpfc"
|
||||||
else
|
else
|
||||||
wo_site_current_cache="basic"
|
wo_site_current_cache="basic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(echo "$wo_site_current_type" | grep wp)" ]; then
|
if [ "$(echo $wo_site_current_type | grep wp)" ]; then
|
||||||
if [ -z "$(echo "$wo_site_current_type" | grep wpsubdir)" ]; then
|
if [ -z "$(echo $wo_site_current_type | grep wpsubdir)" ]; then
|
||||||
wo_site_current="wpsubdir"
|
wo_site_current="wpsubdir"
|
||||||
elif [ -z "$(echo "$wo_site_current_type" | grep wpsudomain)" ]; then
|
elif [ -z "$(echo $wo_site_current_type | grep wpsudomain)" ]; then
|
||||||
wo_site_current="wpsubdomain"
|
wo_site_current="wpsubdomain"
|
||||||
else
|
else
|
||||||
wo_site_current="wp"
|
wo_site_current="wp"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -z "$(echo "$wo_site_current_type" | grep location)" ]; then
|
if [ -z "$(echo $wo_site_current_type | grep location)" ]; then
|
||||||
wo_site_current="proxy"
|
wo_site_current="proxy"
|
||||||
elif [ -z "$(echo "$wo_site_current_type" | grep php)" ]; then
|
elif [ -z "$(echo $wo_site_current_type | grep php)" ]; then
|
||||||
wo_site_current="html"
|
wo_site_current="html"
|
||||||
else
|
else
|
||||||
if [ -f /var/www/${site}/ee-config.php ] || [ -f /var/www/${site}/wo-config.php ]; then
|
if [ -f /var/www/${site}/ee-config.php ] || [ -f /var/www/${site}/wo-config.php ]; then
|
||||||
@@ -377,10 +382,12 @@ wo_install_acme_sh() {
|
|||||||
# Now, finally, let's install WordOps
|
# Now, finally, let's install WordOps
|
||||||
wo_install() {
|
wo_install() {
|
||||||
{
|
{
|
||||||
|
if [ ! -d /tmp/WordOps ]; then
|
||||||
|
git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$wo_branch"
|
||||||
|
fi
|
||||||
cd /tmp/WordOps || exit 1
|
cd /tmp/WordOps || exit 1
|
||||||
} >> "$wo_install_log" 2>&1
|
} >> "$wo_install_log" 2>&1
|
||||||
python3 setup.py install
|
python3 setup.py install
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_upgrade_nginx() {
|
wo_upgrade_nginx() {
|
||||||
|
|||||||
2
wo.sh
2
wo.sh
@@ -15,7 +15,7 @@
|
|||||||
###
|
###
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
wo_lib_echo_fail "Sudo privilege required..."
|
wo_lib_echo_fail "Sudo privilege required..."
|
||||||
wo_lib_echo_fail "Use: wget -qO wo wops.cc && sudo bash wo"
|
wo_lib_echo_fail "Use: curl -sL wops.cc | sudo bash"
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user