allow installer to continue with additional rpm based distros

- FedBerry (Fedora based ARM image)
- Scientific Linux (CentOS based)
- Add prompt to continue installing on unsupported RPM based distros

Signed-off-by: bcambl <blayne@blaynecampbell.com>
This commit is contained in:
bcambl 2018-08-29 20:45:20 -06:00
parent a9c6d79cda
commit 24b4aabae9

View file

@ -244,17 +244,17 @@ elif command -v rpm &> /dev/null; then
LIGHTTPD_GROUP="lighttpd" LIGHTTPD_GROUP="lighttpd"
LIGHTTPD_CFG="lighttpd.conf.fedora" LIGHTTPD_CFG="lighttpd.conf.fedora"
# If the host OS is Fedora, # If the host OS is Fedora,
if grep -qi 'fedora' /etc/redhat-release; then if grep -qiE 'fedora|fedberry' /etc/redhat-release; then
# all required packages should be available by default with the latest fedora release # all required packages should be available by default with the latest fedora release
# ensure 'php-json' is installed on Fedora (installed as dependency on CentOS7 + Remi repository) # ensure 'php-json' is installed on Fedora (installed as dependency on CentOS7 + Remi repository)
PIHOLE_WEB_DEPS+=('php-json') PIHOLE_WEB_DEPS+=('php-json')
# or if host OS is CentOS, # or if host OS is CentOS,
elif grep -qi 'centos' /etc/redhat-release; then elif grep -qiE 'centos|scientific' /etc/redhat-release; then
# Pi-Hole currently supports CentOS 7+ with PHP7+ # Pi-Hole currently supports CentOS 7+ with PHP7+
SUPPORTED_CENTOS_VERSION=7 SUPPORTED_CENTOS_VERSION=7
SUPPORTED_CENTOS_PHP_VERSION=7 SUPPORTED_CENTOS_PHP_VERSION=7
# Check current CentOS major release version # Check current CentOS major release version
CURRENT_CENTOS_VERSION=$(rpm -q --queryformat '%{VERSION}' centos-release) CURRENT_CENTOS_VERSION=$(grep -oP '(?<= )[0-9]+(?=\.)' /etc/redhat-release)
# Check if CentOS version is supported # Check if CentOS version is supported
if [[ $CURRENT_CENTOS_VERSION -lt $SUPPORTED_CENTOS_VERSION ]]; then if [[ $CURRENT_CENTOS_VERSION -lt $SUPPORTED_CENTOS_VERSION ]]; then
echo -e " ${CROSS} CentOS $CURRENT_CENTOS_VERSION is not suported." echo -e " ${CROSS} CentOS $CURRENT_CENTOS_VERSION is not suported."
@ -305,13 +305,15 @@ elif command -v rpm &> /dev/null; then
fi fi
fi fi
else else
# If not a supported version of Fedora or CentOS, # Warn user of unsupported version of Fedora or CentOS
echo -e " ${CROSS} Unsupported RPM based distribution" if ! whiptail --defaultno --title "Unsupported RPM based distribution" --yesno "Would you like to continue installation on an unsupported RPM based distribution?\\n\\nPlease ensure the following packages have been installed manually:\\n\\n- lighttpd\\n- lighttpd-fastcgi\\n- PHP version 7+" ${r} ${c}; then
# exit the installer exit # exit the installer
exit else
: # continue with unsupported RPM distribution
fi
fi fi
# If neither apt-get or rmp/dnf are found # If neither apt-get or yum/dnf are found
else else
# it's not an OS we can support, # it's not an OS we can support,
echo -e " ${CROSS} OS distribution not supported" echo -e " ${CROSS} OS distribution not supported"