Skip to content

Commit d2e8b4c

Browse files
author
Kristan Kenney
committed
Update unsupported OS message
1 parent 5a5c59f commit d2e8b4c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

install/hst-install.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,26 @@ case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
4242
*) type="NoSupport" ;;
4343
esac
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
5365
if [ "$type" = "NoSupport" ]; then
5466
no_support_message
5567
fi
@@ -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.
9797
if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
9898
check_wget_curl
9999
else
100100
no_support_message
101101
fi
102102

103-
exit
103+
exit

0 commit comments

Comments
 (0)