Skip to content

Commit 1a42f99

Browse files
author
Kristan Kenney
committed
Abort installation before adding custom APT repositories
1 parent ed4e4f9 commit 1a42f99

File tree

2 files changed

+42
-38
lines changed

2 files changed

+42
-38
lines changed

install/hst-install-debian.sh

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ fi
301301
# Welcome message
302302
echo "Welcome to the Hestia Control Panel installer!"
303303
echo
304-
echo "Please wait a moment while we update your system's repositories and"
305-
echo "install any necessary dependencies required to proceed with the installation..."
304+
echo "Please wait, the installer is now checking for missing dependencies..."
306305
echo
307306

308307
# Update apt repository
@@ -413,6 +412,25 @@ if [ -d /etc/netplan ] && [ -z "$force" ]; then
413412
fi
414413
fi
415414

415+
# Validate whether installation script matches release version before continuing with install
416+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
417+
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
418+
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
419+
echo
420+
echo -e "\e[91mInstallation aborted\e[0m"
421+
echo "===================================================================="
422+
echo -e "\e[33mERROR: Install script version does not match package version!\e[0m"
423+
echo -e "\e[33mPlease download the installer from the release branch in order to continue:\e[0m"
424+
echo ""
425+
echo -e "\e[33mhttps://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh\e[0m"
426+
echo ""
427+
echo -e "\e[33mTo test pre-release versions, build the .deb packages and re-run the installer:\e[0m"
428+
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
429+
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
430+
echo ""
431+
check_result 1 "Installation aborted"
432+
fi
433+
fi
416434

417435
#----------------------------------------------------------#
418436
# Brief Info #
@@ -432,7 +450,7 @@ echo " v${HESTIA_INSTALL_VER}"
432450
echo -e "\n"
433451
echo "===================================================================="
434452
echo -e "\n"
435-
echo 'The following server components will be installed on your system:'
453+
echo 'The following components will be installed on your server:'
436454
echo
437455

438456
# Web stack
@@ -833,22 +851,6 @@ fi
833851
# Install packages #
834852
#----------------------------------------------------------#
835853

836-
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
837-
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
838-
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
839-
echo
840-
echo -e "\e[91mInstallation Aborted\e[0m"
841-
echo "===================================================================="
842-
echo -e "\e[33mInstall script does not match Hestia release version\e[0m"
843-
echo -e "\e[33mPlease use the installer from the release branch\e[0m"
844-
echo ""
845-
echo -e "\e[33mTo test the beta version you need to build the hestia deb packages and re-run the installer\e[0m"
846-
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
847-
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
848-
check_result 1 "Installation aborted"
849-
fi
850-
fi
851-
852854
# Disabling daemon autostart on apt-get install
853855
echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
854856
chmod a+x /usr/sbin/policy-rc.d

install/hst-install-ubuntu.sh

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ fi
283283
# Welcome message
284284
echo "Welcome to the Hestia Control Panel installer!"
285285
echo
286-
echo "Please wait a moment while we update your system's repositories and"
287-
echo "install any necessary dependencies required to proceed with the installation..."
286+
echo "Please wait, the installer is now checking for missing dependencies..."
288287
echo
289288

290289
# Update apt repository
@@ -388,6 +387,25 @@ if [ -d /etc/netplan ] && [ -z "$force" ]; then
388387
fi
389388
fi
390389

390+
# Validate whether installation script matches release version before continuing with install
391+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
392+
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
393+
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
394+
echo
395+
echo -e "\e[91mInstallation aborted\e[0m"
396+
echo "===================================================================="
397+
echo -e "\e[33mERROR: Install script version does not match package version!\e[0m"
398+
echo -e "\e[33mPlease download the installer from the release branch in order to continue:\e[0m"
399+
echo ""
400+
echo -e "\e[33mhttps://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh\e[0m"
401+
echo ""
402+
echo -e "\e[33mTo test pre-release versions, build the .deb packages and re-run the installer:\e[0m"
403+
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
404+
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
405+
echo ""
406+
check_result 1 "Installation aborted"
407+
fi
408+
fi
391409

392410
#----------------------------------------------------------#
393411
# Brief Info #
@@ -407,7 +425,7 @@ echo " v${HESTIA_INSTALL_VER}"
407425
echo -e "\n"
408426
echo "===================================================================="
409427
echo -e "\n"
410-
echo 'The following server components will be installed on your system:'
428+
echo 'The following components will be installed on your server:'
411429
echo
412430

413431
# Web stack
@@ -831,22 +849,6 @@ fi
831849
# Install packages #
832850
#----------------------------------------------------------#
833851

834-
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
835-
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
836-
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
837-
echo
838-
echo -e "\e[91mInstallation Aborted\e[0m"
839-
echo "===================================================================="
840-
echo -e "\e[33mInstall script does not match Hestia release version\e[0m"
841-
echo -e "\e[33mPlease use the installer from the release branch\e[0m"
842-
echo ""
843-
echo -e "\e[33mTo test the beta version you need to build the hestia deb packages and re-run the installer\e[0m"
844-
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
845-
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
846-
check_result 1 "Installation aborted"
847-
fi
848-
fi
849-
850852
# Disabling daemon autostart on apt-get install
851853
echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
852854
chmod a+x /usr/sbin/policy-rc.d

0 commit comments

Comments
 (0)