From 24b4aabae95397fd8521ac804ff87c5ec3ff1338 Mon Sep 17 00:00:00 2001 From: bcambl Date: Wed, 29 Aug 2018 20:45:20 -0600 Subject: [PATCH] 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 --- automated install/basic-install.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index a08bb3e3..6b8274be 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -244,17 +244,17 @@ elif command -v rpm &> /dev/null; then LIGHTTPD_GROUP="lighttpd" LIGHTTPD_CFG="lighttpd.conf.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 # ensure 'php-json' is installed on Fedora (installed as dependency on CentOS7 + Remi repository) PIHOLE_WEB_DEPS+=('php-json') # 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+ SUPPORTED_CENTOS_VERSION=7 SUPPORTED_CENTOS_PHP_VERSION=7 # 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 if [[ $CURRENT_CENTOS_VERSION -lt $SUPPORTED_CENTOS_VERSION ]]; then echo -e " ${CROSS} CentOS $CURRENT_CENTOS_VERSION is not suported." @@ -305,13 +305,15 @@ elif command -v rpm &> /dev/null; then fi fi else - # If not a supported version of Fedora or CentOS, - echo -e " ${CROSS} Unsupported RPM based distribution" - # exit the installer - exit + # Warn user of unsupported version of Fedora or CentOS + 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 # exit the installer + else + : # continue with unsupported RPM distribution + fi fi -# If neither apt-get or rmp/dnf are found +# If neither apt-get or yum/dnf are found else # it's not an OS we can support, echo -e " ${CROSS} OS distribution not supported"