|
@@ -16,8 +16,6 @@
|
|
|
export PATH=$PATH:/sbin
|
|
export PATH=$PATH:/sbin
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
RHOST='apt.hestiacp.com'
|
|
RHOST='apt.hestiacp.com'
|
|
|
-RHOSTBETA='beta.hestiacp.com'
|
|
|
|
|
-
|
|
|
|
|
GPG='gpg.hestiacp.com'
|
|
GPG='gpg.hestiacp.com'
|
|
|
VERSION='ubuntu'
|
|
VERSION='ubuntu'
|
|
|
HESTIA='/usr/local/hestia'
|
|
HESTIA='/usr/local/hestia'
|
|
@@ -86,7 +84,6 @@ help() {
|
|
|
-e, --email Set admin email
|
|
-e, --email Set admin email
|
|
|
-p, --password Set admin password
|
|
-p, --password Set admin password
|
|
|
-D, --with-debs Path to Hestia debs
|
|
-D, --with-debs Path to Hestia debs
|
|
|
- -B, --beta Development version [yes|no] default: yes
|
|
|
|
|
-f, --force Force installation
|
|
-f, --force Force installation
|
|
|
-h, --help Print this help
|
|
-h, --help Print this help
|
|
|
|
|
|
|
@@ -218,7 +215,6 @@ for arg; do
|
|
|
--email) args="${args}-e " ;;
|
|
--email) args="${args}-e " ;;
|
|
|
--password) args="${args}-p " ;;
|
|
--password) args="${args}-p " ;;
|
|
|
--force) args="${args}-f " ;;
|
|
--force) args="${args}-f " ;;
|
|
|
- --beta) args="${args}-B " ;;
|
|
|
|
|
--with-debs) args="${args}-D " ;;
|
|
--with-debs) args="${args}-D " ;;
|
|
|
--help) args="${args}-h " ;;
|
|
--help) args="${args}-h " ;;
|
|
|
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
|
|
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
|
|
@@ -228,7 +224,7 @@ done
|
|
|
eval set -- "$args"
|
|
eval set -- "$args"
|
|
|
|
|
|
|
|
# Parsing arguments
|
|
# Parsing arguments
|
|
|
-while getopts "a:w:v:j:k:m:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:D:B:fh" Option; do
|
|
|
|
|
|
|
+while getopts "a:w:v:j:k:m:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:D:fh" Option; do
|
|
|
case $Option in
|
|
case $Option in
|
|
|
a) apache=$OPTARG ;; # Apache
|
|
a) apache=$OPTARG ;; # Apache
|
|
|
w) phpfpm=$OPTARG ;; # PHP-FPM
|
|
w) phpfpm=$OPTARG ;; # PHP-FPM
|
|
@@ -253,7 +249,6 @@ while getopts "a:w:v:j:k:m:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:D:B:fh" Option; do
|
|
|
s) servername=$OPTARG ;; # Hostname
|
|
s) servername=$OPTARG ;; # Hostname
|
|
|
e) email=$OPTARG ;; # Admin email
|
|
e) email=$OPTARG ;; # Admin email
|
|
|
p) vpass=$OPTARG ;; # Admin password
|
|
p) vpass=$OPTARG ;; # Admin password
|
|
|
- B) beta=$OPTARG ;; # Beta / Development version
|
|
|
|
|
D) withdebs=$OPTARG ;; # Hestia debs path
|
|
D) withdebs=$OPTARG ;; # Hestia debs path
|
|
|
f) force='yes' ;; # Force install
|
|
f) force='yes' ;; # Force install
|
|
|
h) help ;; # Help
|
|
h) help ;; # Help
|
|
@@ -289,7 +284,6 @@ set_default_value 'fail2ban' 'yes'
|
|
|
set_default_value 'quota' 'no'
|
|
set_default_value 'quota' 'no'
|
|
|
set_default_value 'interactive' 'yes'
|
|
set_default_value 'interactive' 'yes'
|
|
|
set_default_value 'api' 'yes'
|
|
set_default_value 'api' 'yes'
|
|
|
-set_default_value 'beta' 'no'
|
|
|
|
|
set_default_port '8083'
|
|
set_default_port '8083'
|
|
|
set_default_lang 'en'
|
|
set_default_lang 'en'
|
|
|
|
|
|
|
@@ -422,11 +416,10 @@ if [ -d /etc/netplan ] && [ -z "$force" ]; then
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+# Validate whether installation script matches release version before continuing with install
|
|
|
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
|
|
if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
|
|
|
- # Validate whether installation script matches release version before continuing with install
|
|
|
|
|
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
|
|
release_branch_ver=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/release/src/deb/hestia/control |grep "Version:" |awk '{print $2}')
|
|
|
- if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ] && [ $beta != 'yes' ]; then
|
|
|
|
|
|
|
+ if [ "$HESTIA_INSTALL_VER" != "$release_branch_ver" ]; then
|
|
|
echo
|
|
echo
|
|
|
echo -e "\e[91mInstallation aborted\e[0m"
|
|
echo -e "\e[91mInstallation aborted\e[0m"
|
|
|
echo "===================================================================="
|
|
echo "===================================================================="
|
|
@@ -441,20 +434,6 @@ if [ -z "$withdebs" ] || [ ! -d "$withdebs" ]; then
|
|
|
echo ""
|
|
echo ""
|
|
|
check_result 1 "Installation aborted"
|
|
check_result 1 "Installation aborted"
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|
|
|
- # Validate if a development version is installed when --beta is enabled
|
|
|
|
|
- DISPLAY_VER=$(echo $HESTIA_INSTALL_VER | sed "s|~alpha||g" | sed "s|~beta||g")
|
|
|
|
|
- if [ "$HESTIA_INSTALL_VER" = "$DISPLAY_VER" ] && [ $beta = 'yes' ]; then
|
|
|
|
|
- echo
|
|
|
|
|
- echo -e "\e[91mInstallation aborted\e[0m"
|
|
|
|
|
- echo "===================================================================="
|
|
|
|
|
- echo -e "\e[33mERROR: Unable to use beta atp server for stable release\e[0m"
|
|
|
|
|
- echo -e "\e[33mPlease remove the -B or --beta flag from the installer string\e[0m"
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- echo ""
|
|
|
|
|
- check_result 1 "Installation aborted"
|
|
|
|
|
- fi
|
|
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
case $architecture in
|
|
case $architecture in
|
|
@@ -501,7 +480,7 @@ install_welcome_message() {
|
|
|
echo " www.hestiacp.com "
|
|
echo " www.hestiacp.com "
|
|
|
echo
|
|
echo
|
|
|
echo "========================================================================"
|
|
echo "========================================================================"
|
|
|
- echo
|
|
|
|
|
|
|
+ echo
|
|
|
echo "Thank you for downloading Hestia Control Panel! In a few moments,"
|
|
echo "Thank you for downloading Hestia Control Panel! In a few moments,"
|
|
|
echo "we will begin installing the following components on your server:"
|
|
echo "we will begin installing the following components on your server:"
|
|
|
echo
|
|
echo
|
|
@@ -719,14 +698,6 @@ echo "[ * ] Hestia Control Panel"
|
|
|
echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/hestia-keyring.gpg] https://$RHOST/ $codename main" > $apt/hestia.list
|
|
echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/hestia-keyring.gpg] https://$RHOST/ $codename main" > $apt/hestia.list
|
|
|
gpg --no-default-keyring --keyring /usr/share/keyrings/hestia-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A189E93654F0B0E5 >/dev/null 2>&1
|
|
gpg --no-default-keyring --keyring /usr/share/keyrings/hestia-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A189E93654F0B0E5 >/dev/null 2>&1
|
|
|
|
|
|
|
|
-if [ "$beta" = 'yes' ]; then
|
|
|
|
|
- # Enable preview mode
|
|
|
|
|
- sed -i 's/deb/#deb/' $apt/hestia.list
|
|
|
|
|
- echo "[ ! ] Hestia Control Panel (Preview version)"
|
|
|
|
|
- echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/hestia-beta-keyring.gpg] https://$RHOSTBETA/ $codename main" > $apt/hestia-beta.list
|
|
|
|
|
- curl -s "https://$RHOSTBETA/pubkey.gpg" | gpg --dearmor | tee /usr/share/keyrings/hestia-beta-keyring.gpg >/dev/null 2>&1
|
|
|
|
|
-fi
|
|
|
|
|
-
|
|
|
|
|
# Installing PostgreSQL repo
|
|
# Installing PostgreSQL repo
|
|
|
if [ "$postgresql" = 'yes' ]; then
|
|
if [ "$postgresql" = 'yes' ]; then
|
|
|
echo "[ * ] PostgreSQL"
|
|
echo "[ * ] PostgreSQL"
|