Add snippet 'get-path-of-php-command.sh' and change concerning code..

This commit is contained in:
2023-08-03 00:11:02 +02:00
parent 1df7bb124b
commit d84294cf0b
18 changed files with 287 additions and 117 deletions

View File

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