Просмотр исходного кода

Add extra check when users call hst-install-ubuntu / hst-install-debian (#4487)

Jaap Marcus 1 год назад
Родитель
Сommit
3b18ce421c
2 измененных файлов с 14 добавлено и 0 удалено
  1. 7 0
      install/hst-install-debian.sh
  2. 7 0
      install/hst-install-ubuntu.sh

+ 7 - 0
install/hst-install-debian.sh

@@ -426,6 +426,13 @@ if [ -d "/usr/local/hestia" ]; then
 	check_result 1 "Hestia install detected. Unable to continue"
 fi
 
+type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '=')
+if [ "$type" = "ubuntu" ]; then
+	check_result 1 "You are running the wrong installer for Ubuntu. Please run hst-install.sh or hst-install-ubuntu.sh instead."
+elif [ "$type" != "debian" ]; then
+	check_result 1 "You are running an unsupported OS."
+fi
+
 # Clear the screen once launch permissions have been verified
 clear
 

+ 7 - 0
install/hst-install-ubuntu.sh

@@ -422,6 +422,13 @@ if [ -d "/usr/local/hestia" ]; then
 	check_result 1 "Hestia install detected. Unable to continue"
 fi
 
+type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '=')
+if [ "$type" = "debian" ]; then
+	check_result 1 "You are running the wrong installer for Debian. Please run hst-install.sh or hst-install-debian.sh instead."
+elif [ "$type" != "ubuntu" ]; then
+	check_result 1 "You are running an unsupported OS."
+fi
+
 # Clear the screen once launch permissions have been verified
 clear