Compare commits

..

No commits in common. "d84294cf0b084020d9ad15f41f9f04728d67246c" and "17eaf8e278adcd5f5fecae665310728408c7c9be" have entirely different histories.

20 changed files with 241 additions and 319 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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -291,12 +291,7 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
@ -316,8 +311,6 @@ 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: "
@ -523,7 +516,7 @@ echo ""
# - Add missing columns
# -
echononl " Add missing columns .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-columns" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -282,7 +282,6 @@ if [[ "$DATABASE_TYPE" = "postgres" ]]; then
fi
fi
NGINX_IS_ENABLED=false
APACHE2_IS_ENABLED=false
@ -290,16 +289,9 @@ APACHE2_IS_ENABLED=false
#
source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
CURRENT_VERSION="$(basename $CURRENT_INSTALL_DIR | cut -d"-" -f2)"
@ -318,8 +310,6 @@ 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: "
@ -525,7 +515,7 @@ echo ""
# - Create missing indices
# -
echononl " Add missing indices .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-indices" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -291,12 +291,7 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR="$(realpath ${WEB_BASE_DIR}/nextcloud)"
@ -316,8 +311,6 @@ 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: "
@ -523,7 +516,7 @@ echo ""
# - Create missing indices
# -
echononl " Add missing primary keys .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ db:add-missing-primary-keys" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -320,23 +320,110 @@ if [[ "$DATABASE_TYPE" = "postgres" ]]; then
fi
fi
NGINX_IS_ENABLED=false
APACHE2_IS_ENABLED=false
# Get Webservice environment as IS_HTTPD_RUNNING, HTTP_USER, HTTP_GROUP..
# Check if NGINX webserver is ctive
#
source ${snippet_dir}/get-webservice-environment.sh
if $(systemctl -q is-enabled nginx 2> /dev/null) ; then
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.sh
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`
@ -396,8 +483,6 @@ 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 ""
@ -436,7 +521,7 @@ echo ""
# -
echononl " Add user \033[37m\033[1m$USER\033[m to group \033[37m\033[1m$GROUP\033[m .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
if [[ $? -eq 0 ]]; then
echo_ok
else
@ -444,7 +529,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:adduser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
echo "su -c \"/usr/local/php/bin/php ${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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -304,13 +304,15 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -305,13 +305,15 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
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!"
@ -377,7 +379,7 @@ echo ""
# -
echononl " Check, if we can disable legacy encryption - Checking for old files.."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
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)"
@ -386,7 +388,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ encryption:scan:legacy-format\" -s /bin/bash $HTTP_USER"
echo "su -c \"/usr/local/php/bin/php ${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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -304,13 +304,15 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
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,42 +212,17 @@ if [[ -z "$WEBSITE" ]] ; then
# Which cloud instance (website) would you like to update
#
source ${snippet_dir}/get-cloud-instance-to-update.sh
source ${snippet_dir}/get-cloud-instance-to-update
fi
# - 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
WEB_BASE_DIR="/var/www/${WEBSITE}"
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)"
@ -300,15 +275,11 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.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
if [[ -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

@ -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.sh
source ${snippet_dir}/get-cloud-instance-to-update
fi
@ -228,33 +228,14 @@ 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'
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
WEB_BASE_DIR="/var/www/${WEBSITE}"
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)"
@ -307,15 +288,11 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.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
if [[ -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

@ -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.sh
source ${snippet_dir}/get-cloud-instance-to-update
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi
@ -228,33 +228,13 @@ 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'
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
WEB_BASE_DIR="/var/www/${WEBSITE}"
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)"
@ -313,15 +293,11 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.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
if [[ -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

@ -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.sh
source ${snippet_dir}/get-cloud-instance-to-update
#fatal "No website ios given on commandline - Missing Parameter '-s <website>'"
fi
@ -228,33 +228,13 @@ 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'
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
WEB_BASE_DIR="/var/www/${WEBSITE}"
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)"
@ -313,15 +293,11 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.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
if [[ -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

@ -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.sh
source ${snippet_dir}/get-cloud-instance-to-update
fi
@ -228,33 +228,13 @@ 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'
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
WEB_BASE_DIR="/var/www/${WEBSITE}"
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)"
@ -312,15 +292,11 @@ APACHE2_IS_ENABLED=false
source ${snippet_dir}/get-webservice-environment.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
if [[ -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

@ -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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -332,13 +332,7 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_DATA_DIR=`realpath ${WEB_BASE_DIR}/data`
@ -398,8 +392,6 @@ 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 ""
@ -438,7 +430,7 @@ echo ""
# -
echononl " Remove user \033[37m\033[1m$USER\033[m from group \033[37m\033[1m$GROUP\033[m .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'" -s /bin/bash $HTTP_USER > $log_file 2>&1
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
if [[ $? -eq 0 ]]; then
echo_ok
else
@ -446,7 +438,7 @@ else
blank_line
echo ""
echo -e "\033[37m\033[1mcommandline was:\033[m"
echo -e "su -c \"${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ group:removeuser '$GROUP' '$USER'\" -s /bin/bash $HTTP_USER"
echo -e "su -c \"/usr/local/php/bin/php ${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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -293,17 +293,7 @@ source ${snippet_dir}/get-webservice-environment.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
if [[ ! -x "$PHP_BIN" ]]; then
fatal "No PHP binary found!"
fi
source ${snippet_dir}/get-php-major-version
echo ""
echo -e " \033[32m--\033[m"
@ -357,8 +347,6 @@ 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: "
@ -388,7 +376,7 @@ echo ""
# - Create missing indices
# -
echononl " Replace Favicon Icon with \033[1m$(basename ${CUSTOM_FAVICON_PATH})\033[m .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ theming:config favicon ${CUSTOM_FAVICON_PATH}" \
su -c "/usr/local/php/bin/php ${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,17 +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.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
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -303,12 +293,7 @@ source ${snippet_dir}/get-webservice-environment.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
source ${snippet_dir}/get-php-major-version
echo ""
@ -363,8 +348,6 @@ 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: "
@ -394,7 +377,7 @@ echo ""
# - Create missing indices
# -
echononl " Replace Logo with \033[1m$(basename ${CUSTOM_LOGO_PATH})\033[m .."
su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ theming:config logo ${CUSTOM_LOGO_PATH}" \
su -c "/usr/local/php/bin/php ${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.sh
source ${snippet_dir}/get-cloud-instance-to-update
# - Reset IFS
@ -298,12 +298,28 @@ source ${snippet_dir}/get-webservice-environment.sh
# Check PHP Version
#
source ${snippet_dir}/get-php-major-version.sh
source ${snippet_dir}/get-php-major-version
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.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
@ -355,7 +371,7 @@ read _IN
done
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_VERSION="$(sudo -u $HTTP_USER ${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
CURRENT_VERSION="$(sudo -u $HTTP_USER $php_binary ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
DATA_DIR=${WEB_BASE_DIR}/data
@ -373,8 +389,7 @@ echo -e " Webserver user.......................: $HTTP_USER"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo -e " PHP binary...........................: $php_binary"
echo ""
echo -e " Version to rstore....................: $RESTORE_VERSION"
echo -e " Backup date was......................: $DATE_RESTORE_VERSION"

View File

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