Compare commits

...

4 Commits

20 changed files with 319 additions and 241 deletions

View File

@ -219,7 +219,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -291,7 +291,12 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
@ -311,6 +316,8 @@ echo -e " Webserver group......................: $HTTP_GROUP"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -n " Type upper case 'YES' to continue executing with this parameters: "
@ -516,7 +523,7 @@ echo ""
# - Add missing columns
# -
echononl " Add missing columns .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ db:add-missing-columns" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-columns" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else

View File

@ -219,7 +219,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -282,6 +282,7 @@ if [[ "$DATABASE_TYPE" = "postgres" ]]; then
fi
fi
NGINX_IS_ENABLED=false
APACHE2_IS_ENABLED=false
@ -289,9 +290,16 @@ APACHE2_IS_ENABLED=false
#
source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $CURRENT_INSTALL_DIR | cut -d"-" -f2)"
@ -310,6 +318,8 @@ echo -e " Webserver group......................: $HTTP_GROUP"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -n " Type upper case 'YES' to continue executing with this parameters: "
@ -515,7 +525,7 @@ echo ""
# - Create missing indices
# -
echononl " Add missing indices .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ db:add-missing-indices" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-indices" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else

View File

@ -219,7 +219,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -291,7 +291,12 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
@ -311,6 +316,8 @@ echo -e " Webserver group......................: $HTTP_GROUP"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -n " Type upper case 'YES' to continue executing with this parameters: "
@ -516,7 +523,7 @@ echo ""
# - Create missing indices
# -
echononl " Add missing primary keys .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ db:add-missing-primary-keys" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-primary-keys" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else

View File

@ -257,7 +257,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -320,110 +320,23 @@ if [[ "$DATABASE_TYPE" = "postgres" ]]; then
fi
fi
NGINX_IS_ENABLED=false
APACHE2_IS_ENABLED=false
# Check if NGINX webserver is ctive
# Get Webservice environment as IS_HTTPD_RUNNING, HTTP_USER, HTTP_GROUP..
#
if $(systemctl -q is-enabled nginx 2> /dev/null) ; then
source ${snippet_dir}/get-webservice-environment.sh
NGINX_IS_ENABLED=true
# - Determin user of the webserver
# -
nginx_binary="$(which nginx)"
if [[ -z "$nginx_binary" ]] ; then
nginx_binary="$(ps -axu | grep -E "nginx:.*master" | grep -v grep | grep -o -E "\S+/nginx")"
if [[ -z "$nginx_binary" ]] ; then
if [[ -x "/usr/local/nginx/bin/nginx" ]]; then
nginx_binary="/usr/local/nginx/bin/nginx"
elif [[ -x "/usr/local/nginx/sbin/nginx" ]]; then
nginx_binary="/usr/local/nginx/sbin/nginx"
fi
fi
fi
if [[ -x "$nginx_binary" ]] ; then
_HTTP_USER="$($nginx_binary -T 2> /dev/null | grep -E "^\s*user\s+\S+;" | grep -o -E "\S+;$" | sed -e 's/;$//')"
fi
# - Is webserver running ?
# -
PID=$(ps aux | grep "$(realpath $nginx_binary)" | grep -e "^root" | grep -v grep | awk '{print$2}')
if [[ "X${PID}X" = "XX" ]] ;then
IS_HTTPD_RUNNING=false
else
IS_HTTPD_RUNNING=true
fi
elif $(systemctl -q is-enabled apache2 2> /dev/null) ; then
APACHE2_IS_ENABLED=true
# - Determin user of the webserver
# -
httpd_binary="`which httpd`"
if [ -z "$httpd_binary" ]; then
httpd_binary="$(ps -axu | grep httpd | grep -e "^root" | grep -v grep | awk '{print$11}')"
if [ -z "$httpd_binary" ]; then
if [ -x "/usr/local/apache2/bin/httpd" ]; then
httpd_binary="/usr/local/apache2/bin/httpd"
fi
fi
fi
if [ -x "$httpd_binary" ];then
# - Determin websever user
# -
_HTTP_USER="`$httpd_binary -t -D DUMP_RUN_CFG | grep -i -e "^User" | awk '{print$2}' | cut -d\"=\" -f2 | tr -d '"'`"
_HTTP_GROUP="`$httpd_binary -t -D DUMP_RUN_CFG | grep -i -e "^Group" | awk '{print$2}' | cut -d\"=\" -f2 | tr -d '"'`"
# - Is webserver running ?
# -
PID=$(ps aux | grep "$(realpath $httpd_binary)" | grep -e "^root" | grep -v grep | awk '{print$2}')
if [[ "X${PID}X" = "XX" ]] ;then
IS_HTTPD_RUNNING=false
else
IS_HTTPD_RUNNING=true
fi
fi
else
error "Neither \033[1mapache2\033[m nor \033[1mnginx\033[m is enabled on this machine"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interrupted by user"
fi
if [[ -n "$_HTTP_USER" ]] ; then
if [[ -n "$HTTP_USER" ]] && [[ "$_HTTP_USER" != "$HTTP_USER" ]]; then
warn "The script has determined \033[1;37m${_HTTP_USER}\033[m as Webservers user. This\n value differs from the value given in your configuration file, \n which is \033[1;37m${HTTP_USER}\033[m and takes precedence."
else
HTTP_USER=$_HTTP_USER
fi
else
[[ -n "$HTTP_USER" ]] || HTTP_USER=$DEFAULT_HTTP_USER
fi
if [[ -n "$_HTTP_GROUP" ]] ; then
if [[ -n "$HTTP_GROUP" ]] && [[ "$_HTTP_GROUP" != "$HTTP_GROUP" ]]; then
warn "The script has determined \033[1;37m${_HTTP_GROUP}\033[m as Webservers group. This\n value differs from the value given in your configuration file, \n which is \033[1;37m${HTTP_GROUP}\033[m and takes precedence."
else
HTTP_GROUP=$_HTTP_GROUP
fi
else
[[ -n "$HTTP_GROUP" ]] || HTTP_GROUP=$DEFAULT_HTTP_GROUP
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`
@ -483,6 +396,8 @@ echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -e " Databse name.........................: $DATABASE_NAME"
echo -e " Database type........................: $DATABASE_TYPE"
echo ""
@ -521,7 +436,7 @@ echo ""
# -
echononl " Add user \033[37m\033[1m$USER\033[m to group \033[37m\033[1m$GROUP\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
@ -529,7 +444,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo "su -c \"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
echo "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
blank_line
warn "Despite errors, it is possible that the user \033[37m\033[1m$USER\033[m was added to the group \033[37m\033[1m$GROUP\033[m"
fatal "$(cat $log_file)"

View File

@ -228,7 +228,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -304,15 +304,13 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"
elif [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -228,7 +228,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -305,15 +305,13 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"
elif [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"
@ -379,7 +377,7 @@ echo ""
# -
echononl " Check, if we can disable legacy encryption - Checking for old files.."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
info "Output of command \033[37m\033[1mocc encryption:scan:legacy-format\033[m was:\n\n$(cat $log_file)"
@ -388,7 +386,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo "su -c \"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format\" -s /bin/bash $HTTP_USER"
echo "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format\" -s /bin/bash $HTTP_USER"
error "Output of command \033[37m\033[1mocc encryption:scan:legacy-format\033[m was:\n\n$(cat $log_file)"
fi

View File

@ -228,7 +228,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -304,15 +304,13 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"
elif [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -212,17 +212,42 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
fi
WEB_BASE_DIR="/var/www/${WEBSITE}"
# - Reset IFS
# -
IFS=$CUR_IFS
DEFAULT_SRC_BASE_DIR="/usr/local/src/nextcloud"
DEFAULT_HTTP_USER="www-data"
DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE='FPM'
echo ""
echononl " Include Configuration file.."
if [[ ! -f $conf_file ]]; then
echo_failed
fatal "Missing configuration file '$conf_file'."
else
source $conf_file
echo_ok
fi
echo ""
DEFAULT_WEB_BASE_DIR="/var/www/${WEBSITE}"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
if [[ ! -d ${WEB_BASE_DIR} ]] ; then
fatal "Web base directory '$WEB_BASE_DIR' not found!"
fi
DATA_DIR="$(realpath ${WEB_BASE_DIR}/data)"
[[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE
INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $INSTALL_DIR | cut -d"-" -f2)"
@ -275,11 +300,15 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.sh
if [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -219,7 +219,7 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
fi
@ -228,14 +228,33 @@ fi
# -
IFS=$CUR_IFS
DEFAULT_SRC_BASE_DIR="/usr/local/src/nextcloud"
DEFAULT_HTTP_USER="www-data"
DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE='FPM'
WEB_BASE_DIR="/var/www/${WEBSITE}"
echo ""
echononl " Include Configuration file.."
if [[ ! -f $conf_file ]]; then
echo_failed
fatal "Missing configuration file '$conf_file'."
else
source $conf_file
echo_ok
fi
echo ""
DEFAULT_WEB_BASE_DIR="/var/www/${WEBSITE}"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
if [[ ! -d ${WEB_BASE_DIR} ]] ; then
fatal "Web base directory '$WEB_BASE_DIR' not found!"
fi
DATA_DIR="$(realpath ${WEB_BASE_DIR}/data)"
[[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE
INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $INSTALL_DIR | cut -d"-" -f2)"
@ -288,11 +307,15 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.sh
if [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -218,7 +218,7 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi
@ -228,13 +228,33 @@ fi
# -
IFS=$CUR_IFS
WEB_BASE_DIR="/var/www/${WEBSITE}"
DEFAULT_SRC_BASE_DIR="/usr/local/src/nextcloud"
DEFAULT_HTTP_USER="www-data"
DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE='FPM'
echo ""
echononl " Include Configuration file.."
if [[ ! -f $conf_file ]]; then
echo_failed
fatal "Missing configuration file '$conf_file'."
else
source $conf_file
echo_ok
fi
echo ""
DEFAULT_WEB_BASE_DIR="/var/www/${WEBSITE}"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
if [[ ! -d ${WEB_BASE_DIR} ]] ; then
fatal "Web base directory '$WEB_BASE_DIR' not found!"
fi
DATA_DIR="$(realpath ${WEB_BASE_DIR}/data)"
[[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE
INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $INSTALL_DIR | cut -d"-" -f2)"
@ -293,11 +313,15 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.sh
if [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -218,7 +218,7 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi
@ -228,13 +228,33 @@ fi
# -
IFS=$CUR_IFS
WEB_BASE_DIR="/var/www/${WEBSITE}"
DEFAULT_SRC_BASE_DIR="/usr/local/src/nextcloud"
DEFAULT_HTTP_USER="www-data"
DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE='FPM'
echo ""
echononl " Include Configuration file.."
if [[ ! -f $conf_file ]]; then
echo_failed
fatal "Missing configuration file '$conf_file'."
else
source $conf_file
echo_ok
fi
echo ""
DEFAULT_WEB_BASE_DIR="/var/www/${WEBSITE}"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
if [[ ! -d ${WEB_BASE_DIR} ]] ; then
fatal "Web base directory '$WEB_BASE_DIR' not found!"
fi
DATA_DIR="$(realpath ${WEB_BASE_DIR}/data)"
[[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE
INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $INSTALL_DIR | cut -d"-" -f2)"
@ -293,11 +313,15 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.sh
if [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -219,7 +219,7 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
fi
@ -228,13 +228,33 @@ fi
# -
IFS=$CUR_IFS
WEB_BASE_DIR="/var/www/${WEBSITE}"
DEFAULT_SRC_BASE_DIR="/usr/local/src/nextcloud"
DEFAULT_HTTP_USER="www-data"
DEFAULT_HTTP_GROUP="www-data"
DEFAULT_PHP_ENGINE='FPM'
echo ""
echononl " Include Configuration file.."
if [[ ! -f $conf_file ]]; then
echo_failed
fatal "Missing configuration file '$conf_file'."
else
source $conf_file
echo_ok
fi
echo ""
DEFAULT_WEB_BASE_DIR="/var/www/${WEBSITE}"
[[ -n "$WEB_BASE_DIR" ]] || WEB_BASE_DIR=$DEFAULT_WEB_BASE_DIR
if [[ ! -d ${WEB_BASE_DIR} ]] ; then
fatal "Web base directory '$WEB_BASE_DIR' not found!"
fi
DATA_DIR="$(realpath ${WEB_BASE_DIR}/data)"
[[ -n "$PHP_ENGINE" ]] || PHP_ENGINE=$DEFAULT_PHP_ENGINE
INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $INSTALL_DIR | cut -d"-" -f2)"
@ -292,11 +312,15 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.sh
if [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"

View File

@ -258,7 +258,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -332,7 +332,13 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`
@ -392,6 +398,8 @@ echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP command..........................: $PHP_BIN"
echo ""
echo -e " Databse name.........................: $DATABASE_NAME"
echo -e " Database type........................: $DATABASE_TYPE"
echo ""
@ -430,7 +438,7 @@ echo ""
# -
echononl " Remove user \033[37m\033[1m$USER\033[m from group \033[37m\033[1m$GROUP\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
@ -438,7 +446,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo -e "su -c \"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
echo -e "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
blank_line
warn "Despite errors, it is possible that the user \033[37m\033[1m$USER\033[m was removed from the group \033[37m\033[1m$GROUP\033[m"
fatal "$(cat $log_file)"

View File

@ -220,7 +220,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -293,7 +293,17 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"
fi
echo ""
echo -e " \033[32m--\033[m"
@ -347,6 +357,8 @@ echo -e " Webserver group......................: $HTTP_GROUP"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -n " Type upper case 'YES' to continue executing with this parameters: "
@ -376,7 +388,7 @@ echo ""
# - Create missing indices
# -
echononl " Replace Favicon Icon with \033[1m$(basename ${CUSTOM_FAVICON_PATH})\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ theming:config favicon ${CUSTOM_FAVICON_PATH}" \
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ theming:config favicon ${CUSTOM_FAVICON_PATH}" \
-s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok

View File

@ -220,7 +220,17 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
# - Reset IFS
@ -293,7 +303,12 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
echo ""
@ -348,6 +363,8 @@ echo -e " Webserver group......................: $HTTP_GROUP"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -n " Type upper case 'YES' to continue executing with this parameters: "
@ -377,7 +394,7 @@ echo ""
# - Create missing indices
# -
echononl " Replace Logo with \033[1m$(basename ${CUSTOM_LOGO_PATH})\033[m .."
su -c "/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ theming:config logo ${CUSTOM_LOGO_PATH}" \
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ theming:config logo ${CUSTOM_LOGO_PATH}" \
-s /bin/bash $HTTP_USER > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok

View File

@ -225,7 +225,7 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# - Reset IFS
@ -298,28 +298,12 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# - Determin PHP binary
# -
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
php_binary="/usr/local/php-${PHP_VERSION}/bin/php"
else
php_binary="$(realpath "$(which php)")"
if [[ -z "$php_binary" ]]; then
if [[ -x "/usr/local/php/bin/php" ]]; then
php_binary="/usr/local/php/bin/php"
else
fatal "No PHP binary present"
fi
else
if [[ ! -x "$php_binary" ]]; then
fatal "Found PHP binary '$php_binary', but this file is not executable!"
fi
fi
fi
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
@ -371,7 +355,7 @@ read _IN
done
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_VERSION="$(sudo -u $HTTP_USER $php_binary ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
CURRENT_VERSION="$(sudo -u $HTTP_USER ${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
DATA_DIR=${WEB_BASE_DIR}/data
@ -389,7 +373,8 @@ echo -e " Webserver user.......................: $HTTP_USER"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo -e " PHP binary...........................: $php_binary"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -e " Version to rstore....................: $RESTORE_VERSION"
echo -e " Backup date was......................: $DATE_RESTORE_VERSION"

View File

@ -0,0 +1,7 @@
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
PHP_BIN="/usr/local/php-${PHP_VERSION}/bin/php"
elif [[ -x "$(realpath /usr/local/php/bin/php)" ]]; then
PHP_BIN="/usr/local/php/bin/php"
else
PHP_BIN="$(which php)"
fi

View File

@ -249,7 +249,12 @@ echo -e "\033[32m-----\033[m"
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update
source ${snippet_dir}/get-cloud-instance-to-update.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
# - Reset IFS
@ -383,27 +388,13 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version
source ${snippet_dir}/get-php-major-version.sh
# - Determin PHP binary
# -
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
php_binary="/usr/local/php-${PHP_VERSION}/bin/php"
else
php_binary="$(realpath "$(which php)")"
if [[ -z "$php_binary" ]]; then
if [[ -x "/usr/local/php/bin/php" ]]; then
php_binary="/usr/local/php/bin/php"
else
fatal "No PHP binary present"
fi
else
if [[ ! -x "$php_binary" ]]; then
fatal "Found PHP binary '$php_binary', but this file is not executable!"
fi
fi
fi
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
# ---
@ -452,7 +443,8 @@ echo -e " Webserver user.......................: $HTTP_USER"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo -e " PHP binary...........................: $php_binary"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -e " Databse name.........................: $DATABASE_NAME"
echo -e " Database type........................: $DATABASE_TYPE"
@ -897,7 +889,7 @@ fi
#_app="calendar"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -920,7 +912,7 @@ fi
#fi
#
#echononl "Eanable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -946,7 +938,7 @@ fi
#_app="contacts"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -969,7 +961,7 @@ fi
#fi
#
#echononl "Enable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -995,7 +987,7 @@ fi
#_app="notes"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -1018,7 +1010,7 @@ fi
#fi
#
#echononl "Eanable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -1044,7 +1036,7 @@ fi
#_app="tasks"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#
#if [[ $? -eq 0 ]]; then
# echo_ok
@ -1068,7 +1060,7 @@ fi
#fi
#
#echononl "Eanable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -1096,7 +1088,7 @@ fi
# _app="richdocuments"
#
# echononl "Install nextcloud app '$_app'.."
# sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
# sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
# if [[ $? -eq 0 ]]; then
# echo_ok
# else
@ -1119,7 +1111,7 @@ fi
# fi
#
# echononl "Eanable nextcloud app '$_app'.."
# sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
# sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
# if [[ $? -eq 0 ]]; then
# echo_ok
# else
@ -1142,7 +1134,7 @@ fi
# echo_skipped
# error "No Wopi URL given (variable 'WOPI_URL')."
# else
# sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" config:app:set richdocuments wopi_url --value="$WOPI_URL" >> $log_file 2>&1
# sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" config:app:set richdocuments wopi_url --value="$WOPI_URL" >> $log_file 2>&1
# if [[ $? -eq 0 ]]; then
# echo_ok
# else
@ -1170,7 +1162,7 @@ fi
#_app="bruteforcesettings"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -1193,7 +1185,7 @@ fi
#fi
#
#echononl "Eanable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#
#if [[ $? -eq 0 ]]; then
# echo_ok
@ -1217,7 +1209,7 @@ fi
#_app="announcementcenter"
#
#echononl "Install nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:install "$_app" > $log_file 2>&1
#if [[ $? -eq 0 ]]; then
# echo_ok
#else
@ -1240,7 +1232,7 @@ fi
#fi
#
#echononl "Eanable nextcloud app '$_app'.."
#sudo -u "$HTTP_USER" "$php_binary" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#sudo -u "$HTTP_USER" "${PHP_BIN}" "${INSTALL_DIR}/occ" app:enable "$_app" > $log_file 2>&1
#
#if [[ $? -eq 0 ]]; then
# echo_ok