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

@ -307,13 +307,11 @@ source ${snippet_dir}/get-webservice-environment.sh
#
source ${snippet_dir}/get-php-major-version.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
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
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