mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Exit installer if no valid PHP version is found
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
de02220a12
commit
1f26e85399
@ -301,8 +301,13 @@ package_manager_detect() {
|
|||||||
local phpVer="php"
|
local phpVer="php"
|
||||||
if is_command php ; then
|
if is_command php ; then
|
||||||
printf " %b Existing PHP installation detected : PHP version %s\\n" "${INFO}" "$(php <<< "<?php echo PHP_VERSION ?>")"
|
printf " %b Existing PHP installation detected : PHP version %s\\n" "${INFO}" "$(php <<< "<?php echo PHP_VERSION ?>")"
|
||||||
printf -v phpInsMajor "%d" "$(php <<< "<?php echo PHP_MAJOR_VERSION ?>")"
|
printf -v phpInsMajor "$(php <<< "<?php echo PHP_MAJOR_VERSION ?>")"
|
||||||
printf -v phpInsMinor "%d" "$(php <<< "<?php echo PHP_MINOR_VERSION ?>")"
|
printf -v phpInsMinor "$(php <<< "<?php echo PHP_MINOR_VERSION ?>")"
|
||||||
|
if [[ "$phpInsMajor" =~ [^[:digit:]] || "$phpInsMinor" =~ [^[:digit:]] ]]; then
|
||||||
|
printf " %b No valid PHP version detected\\n" "${CROSS}"
|
||||||
|
# so exit the installer
|
||||||
|
exit
|
||||||
|
fi
|
||||||
phpVer="php$phpInsMajor.$phpInsMinor"
|
phpVer="php$phpInsMajor.$phpInsMinor"
|
||||||
fi
|
fi
|
||||||
# Packages required to perfom the os_check (stored as an array)
|
# Packages required to perfom the os_check (stored as an array)
|
||||||
|
Loading…
Reference in New Issue
Block a user