Skip to content

Commit 6f1a141

Browse files
committed
[Installer] Abort master branch installer when used without recompiled debs
1 parent 8123181 commit 6f1a141

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

install/hst-install-debian.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ os='debian'
2020
release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
2121
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
2222
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
23+
VERBOSE='no'
2324

2425
# Define software versions
26+
HESTIA_INSTALL_VER='1.1.2'
2527
pma_v='5.0.2'
2628
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
2729
fpm_v="7.3"
@@ -438,7 +440,7 @@ echo ' | _ | __/\__ \ |_| | (_| | |___| __/ '
438440
echo ' |_| |_|\___||___/\__|_|\__,_|\____|_| '
439441
echo
440442
echo ' Hestia Control Panel'
441-
echo ' v1.1.2'
443+
echo " v${HESTIA_INSTALL_VER}"
442444
echo -e "\n"
443445
echo "===================================================================="
444446
echo -e "\n"
@@ -669,6 +671,7 @@ done
669671
echo
670672

671673
# Check Installation result
674+
wait $BACK_PID
672675
check_result $? 'apt-get upgrade failed'
673676

674677

@@ -838,6 +841,22 @@ fi
838841
# Install packages #
839842
#----------------------------------------------------------#
840843

844+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
845+
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
846+
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
847+
echo
848+
echo -e "\e[91mInstallation Aborted\e[0m"
849+
echo "===================================================================="
850+
echo -e "\e[33mInstall script does not match Hestia release version\e[0m"
851+
echo -e "\e[33mPlease use the installer from the release branch\e[0m"
852+
echo ""
853+
echo -e "\e[33mTo test the beta version you need to build the hestia deb packages and re-run the installer\e[0m"
854+
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
855+
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
856+
check_result 1 "Installation aborted"
857+
fi
858+
fi
859+
841860
# Disabling daemon autostart on apt-get install
842861
echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
843862
chmod a+x /usr/sbin/policy-rc.d
@@ -860,6 +879,7 @@ done
860879
echo
861880

862881
# Check Installation result
882+
wait $BACK_PID
863883
check_result $? "apt-get install failed"
864884

865885
# Install Hestia packages from local folder
@@ -1091,7 +1111,7 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
10911111
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
10921112

10931113
# Version & Release Branch
1094-
echo "VERSION='1.1.2'" >> $HESTIA/conf/hestia.conf
1114+
echo "VERSION='${HESTIA_INSTALL_VER}'" >> $HESTIA/conf/hestia.conf
10951115
echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
10961116

10971117
# Installing hosting packages

install/hst-install-ubuntu.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ os='ubuntu'
2020
release="$(lsb_release -s -r)"
2121
codename="$(lsb_release -s -c)"
2222
HESTIA_INSTALL_DIR="$HESTIA/install/deb"
23+
VERBOSE='no'
2324

2425
# Define software versions
26+
HESTIA_INSTALL_VER='1.1.2'
2527
pma_v='5.0.2'
2628
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
2729
fpm_v="7.3"
@@ -401,7 +403,7 @@ echo ' | _ | __/\__ \ |_| | (_| | |___| __/ '
401403
echo ' |_| |_|\___||___/\__|_|\__,_|\____|_| '
402404
echo
403405
echo ' Hestia Control Panel'
404-
echo ' v1.1.2'
406+
echo " v${HESTIA_INSTALL_VER}"
405407
echo -e "\n"
406408
echo "===================================================================="
407409
echo -e "\n"
@@ -620,6 +622,7 @@ done
620622
echo
621623

622624
# Check Installation result
625+
wait $BACK_PID
623626
check_result $? 'apt-get upgrade failed'
624627

625628

@@ -819,6 +822,22 @@ fi
819822
# Install packages #
820823
#----------------------------------------------------------#
821824

825+
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
826+
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
827+
if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
828+
echo
829+
echo -e "\e[91mInstallation Aborted\e[0m"
830+
echo "===================================================================="
831+
echo -e "\e[33mInstall script does not match Hestia release version\e[0m"
832+
echo -e "\e[33mPlease use the installer from the release branch\e[0m"
833+
echo ""
834+
echo -e "\e[33mTo test the beta version you need to build the hestia deb packages and re-run the installer\e[0m"
835+
echo -e " \e[33m./hst_autocompile.sh \e[1m--hestia no\e[21m\e[0m"
836+
echo -e " \e[33m./hst-install.sh .. \e[1m--with-debs /tmp/hestiacp-src/debs\e[21m\e[0m"
837+
check_result 1 "Installation aborted"
838+
fi
839+
fi
840+
822841
# Disabling daemon autostart on apt-get install
823842
echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
824843
chmod a+x /usr/sbin/policy-rc.d
@@ -841,6 +860,7 @@ done
841860
echo
842861

843862
# Check Installation result
863+
wait $BACK_PID
844864
check_result $? "apt-get install failed"
845865

846866
# Install Hestia packages from local folder
@@ -1062,7 +1082,7 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
10621082
echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
10631083

10641084
# Version & Release Branch
1065-
echo "VERSION='1.1.2'" >> $HESTIA/conf/hestia.conf
1085+
echo "VERSION='${HESTIA_INSTALL_VER}'" >> $HESTIA/conf/hestia.conf
10661086
echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
10671087

10681088
# Installing hosting packages

0 commit comments

Comments
 (0)