1111
1212# Am I root?
1313if [ " x$( id -u) " != ' x0' ]; then
14- echo ' Error: this script can only be executed by root'
15- exit 1
14+ echo ' Error: this script can only be executed by root'
15+ exit 1
1616fi
1717
1818# Check admin user account
@@ -43,61 +43,61 @@ case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
4343esac
4444
4545no_support_message () {
46- echo " Your OS is currently not supported."
47- exit 1;
46+ echo " Your OS is currently not supported, please consider to use:"
47+ echo " Debian: 8, 9"
48+ echo " Ubuntu: 16.04, 18.04"
49+ exit 1;
4850}
4951
5052# Check if OS is supported
5153if [ " $type " = " NoSupport" ]; then
52- no_support_message
54+ no_support_message
5355fi
5456
5557check_wget_curl (){
56- # Check wget
57- if [ -e ' /usr/bin/wget' ]; then
58- wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/master/install/hst-install-$type .sh -O hst-install-$type .sh
59- if [ " $? " -eq ' 0' ]; then
60- bash hst-install-$type .sh $*
61- exit
62- else
63- echo " Error: hst-install-$type .sh download failed."
64- exit 1
65- fi
66- fi
58+ # Check wget
59+ if [ -e ' /usr/bin/wget' ]; then
60+ wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/master/install/hst-install-$type .sh -O hst-install-$type .sh
61+ if [ " $? " -eq ' 0' ]; then
62+ bash hst-install-$type .sh $*
63+ exit
64+ else
65+ echo " Error: hst-install-$type .sh download failed."
66+ exit 1
67+ fi
68+ fi
6769
68- # Check curl
69- if [ -e ' /usr/bin/curl' ]; then
70- curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/master/install/hst-install-$type .sh
71- if [ " $? " -eq ' 0' ]; then
72- bash hst-install-$type .sh $*
73- exit
74- else
75- echo " Error: hst-install-$type .sh download failed."
76- exit 1
77- fi
78- fi
70+ # Check curl
71+ if [ -e ' /usr/bin/curl' ]; then
72+ curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/master/install/hst-install-$type .sh
73+ if [ " $? " -eq ' 0' ]; then
74+ bash hst-install-$type .sh $*
75+ exit
76+ else
77+ echo " Error: hst-install-$type .sh download failed."
78+ exit 1
79+ fi
80+ fi
7981}
8082
8183
82- # Detect codename
84+ # Detect codename for debian
8385if [ " $type " = " debian" ]; then
84- codename=" $( cat /etc/os-release | grep VERSION= | cut -f 2 -d \( | cut -f 1 -d \) ) "
85- release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
86- VERSION=' debian'
86+ release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
87+ VERSION=' debian'
8788fi
8889
90+ # Detect codename for ubuntu
8991if [ " $type " = " ubuntu" ]; then
90- codename=" $( lsb_release -s -c) "
91- release=" $( lsb_release -s -r) "
92- VERSION=' ubuntu'
92+ release=" $( lsb_release -s -r) "
93+ VERSION=' ubuntu'
9394fi
9495
9596# Check Ubuntu Version Are Acceptable to install
96- if [ " $codename " = " 14.04 " ] || [ " $codename " = " 16.04" ] || [ " $codename " = " 18.04" ]; then
97- check_wget_curl
97+ if [[ " $release " =~ ^(8 | 9 | 16.04| 18.04)$ ] ]; then
98+ check_wget_curl
9899else
99- no_support_message
100+ no_support_message
100101fi
101102
102-
103- exit
103+ exit
0 commit comments