@@ -42,14 +42,26 @@ case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
4242 * ) type=" NoSupport" ;;
4343esac
4444
45- no_support_message () {
46- echo " Your OS is currently not supported, please consider to use:"
47- echo " Debian: 8, 9"
48- echo " Ubuntu: 16.04, 18.04"
45+ # Detect release for Debian
46+ if [ " $type " = " debian" ]; then
47+ release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
48+ VERSION=' debian'
49+ elif [ " $type " = " ubuntu" ]; then
50+ release=" $( lsb_release -s -r) "
51+ VERSION=' ubuntu'
52+ fi
53+
54+ no_support_message (){
55+ echo " ****************************************************"
56+ echo " Your operating system (OS) is not supported by"
57+ echo " Hestia Control Panel. Officially supported releases:"
58+ echo " ****************************************************"
59+ echo " Debian 8, 9"
60+ echo " Ubuntu 16.04 LTS, 18.04 LTS"
61+ echo " "
4962 exit 1;
5063}
5164
52- # Check if OS is supported
5365if [ " $type " = " NoSupport" ]; then
5466 no_support_message
5567fi
@@ -80,24 +92,12 @@ check_wget_curl(){
8092 fi
8193}
8294
83-
84- # Detect codename for debian
85- if [ " $type " = " debian" ]; then
86- release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
87- VERSION=' debian'
88- fi
89-
90- # Detect codename for ubuntu
91- if [ " $type " = " ubuntu" ]; then
92- release=" $( lsb_release -s -r) "
93- VERSION=' ubuntu'
94- fi
95-
96- # Check Ubuntu Version Are Acceptable to install
95+ # Check for supported operating system before proceeding with download
96+ # of OS-specific installer, and throw error message if unsupported OS detected.
9797if [[ " $release " =~ ^(8| 9| 16.04| 18.04)$ ]]; then
9898 check_wget_curl
9999else
100100 no_support_message
101101fi
102102
103- exit
103+ exit
0 commit comments