Kristan Kenney 7 лет назад
Родитель
Сommit
d2e8b4c4cd
1 измененных файлов с 20 добавлено и 20 удалено
  1. 20 20
      install/hst-install.sh

+ 20 - 20
install/hst-install.sh

@@ -42,14 +42,26 @@ case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
     *)          type="NoSupport" ;;
     *)          type="NoSupport" ;;
 esac
 esac
 
 
-no_support_message() {
-    echo "Your OS is currently not supported, please consider to use:"
-    echo "  Debian:  8, 9"
-    echo "  Ubuntu:  16.04, 18.04"
+# Detect release for Debian
+if [ "$type" = "debian" ]; then
+    release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
+    VERSION='debian'
+elif [ "$type" = "ubuntu" ]; then
+    release="$(lsb_release -s -r)"
+    VERSION='ubuntu'
+fi
+
+no_support_message(){
+    echo "****************************************************"
+	echo "Your operating system (OS) is not supported by"
+	echo "Hestia Control Panel. Officially supported releases:"
+	echo "****************************************************"
+    echo "  Debian 8, 9"
+    echo "  Ubuntu 16.04 LTS, 18.04 LTS"
+	echo ""
     exit 1;
     exit 1;
 }
 }
 
 
-# Check if OS is supported
 if [ "$type" = "NoSupport" ]; then
 if [ "$type" = "NoSupport" ]; then
     no_support_message
     no_support_message
 fi
 fi
@@ -80,24 +92,12 @@ check_wget_curl(){
     fi
     fi
 }
 }
 
 
-
-# Detect codename for debian
-if [ "$type" = "debian" ]; then
-    release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
-    VERSION='debian'
-fi
-
-# Detect codename for ubuntu
-if [ "$type" = "ubuntu" ]; then
-    release="$(lsb_release -s -r)"
-    VERSION='ubuntu'
-fi
-
-# Check Ubuntu Version Are Acceptable to install
+# Check for supported operating system before proceeding with download
+# of OS-specific installer, and throw error message if unsupported OS detected.
 if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
 if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
     check_wget_curl
     check_wget_curl
 else
 else
     no_support_message
     no_support_message
 fi
 fi
 
 
-exit
+exit