@@ -15,14 +15,6 @@ PCRE_V='8.42'
1515ZLIB_V=' 1.2.11'
1616PHP_V=' 7.3.4'
1717
18- # Generate Links for sourcecode
19- HESTIA=' https://github.com/hestiacp/hestiacp/archive/master.zip'
20- NGINX=' https://nginx.org/download/nginx-' $NGINX_V ' .tar.gz'
21- OPENSSL=' https://www.openssl.org/source/openssl-' $OPENSSL_V ' .tar.gz'
22- PCRE=' https://ftp.pcre.org/pub/pcre/pcre-' $PCRE_V ' .tar.gz'
23- ZLIB=' https://www.zlib.net/zlib-' $ZLIB_V ' .tar.gz'
24- PHP=' http://de2.php.net/distributions/php-' $PHP_V ' .tar.gz'
25-
2618# Set package dependencies for compiling
2719SOFTWARE=' build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
2820
@@ -59,17 +51,54 @@ for arg; do
5951 --hestia)
6052 HESTIA_B=' true'
6153 ;;
54+ --install)
55+ answer=' Y'
56+ ;;
6257 * )
6358 NOARGUMENT=' true'
6459 ;;
6560 esac
6661done
6762
63+ # If branch was specified at run-time, convert its value to the branch variable
64+ if [ " $3 " ]; then
65+ branch=$3
66+ fi
67+
68+ if [ ! " $1 " = " --all" ] || [ ! " $1 " = " --hestia" ] || [ ! " $1 " = " --nginx" ] || [ ! " $1 " = " --php" ]; then
69+ echo " (!) Invalid compilation flag specified. Valid flags:"
70+ echo " --all"
71+ echo " --hestia"
72+ echo " --nginx"
73+ echo " --php"
74+ echo " "
75+ echo " You may also specify --install to install the packages after compilation."
76+ fi
77+
78+ # Prompt for Git branch to download and build from if not specified at run-time
79+ if [ ! $3 ]; then
80+ echo -n " Please enter the name of the branch to build from (e.g. master): "
81+ read branch
82+ fi
83+
6884if [[ $# -eq 0 ]] ; then
6985 echo " !!! Please run with argument --all, --hestia, --nginx or --php !!!"
7086 exit 1
7187fi
7288
89+ if [ ! " $2 " = " --install" ]; then
90+ echo -n ' Would you like to install the compiled packages? [Y/N] '
91+ read answer
92+ fi
93+
94+ # Generate Links for sourcecode
95+ HESTIA=' https://github.com/hestiacp/hestiacp/archive/$branch.zip'
96+ NGINX=' https://nginx.org/download/nginx-' $NGINX_V ' .tar.gz'
97+ OPENSSL=' https://www.openssl.org/source/openssl-' $OPENSSL_V ' .tar.gz'
98+ PCRE=' https://ftp.pcre.org/pub/pcre/pcre-' $PCRE_V ' .tar.gz'
99+ ZLIB=' https://www.zlib.net/zlib-' $ZLIB_V ' .tar.gz'
100+ PHP=' http://de2.php.net/distributions/php-' $PHP_V ' .tar.gz'
101+
73102
74103# ################################################################################
75104#
@@ -164,6 +193,7 @@ if [ "$NGINX_B" = true ] ; then
164193 rm -r hestia-nginx_$NGINX_V
165194fi
166195
196+
167197# ################################################################################
168198#
169199# Building hestia-php
@@ -237,6 +267,7 @@ if [ "$PHP_B" = true ] ; then
237267 rm -r hestia-php_$PHP_V
238268fi
239269
270+
240271# ################################################################################
241272#
242273# Building hestia
@@ -291,3 +322,18 @@ if [ "$HESTIA_B" = true ] ; then
291322 rm -r hestia_$HESTIA_V
292323 rm -r hestiacp-master
293324fi
325+
326+
327+ # ################################################################################
328+ #
329+ # Install Packages
330+ #
331+ # ################################################################################
332+
333+ if [ " $answer " = ' y' ] || [ " $answer " = ' Y' ]; then
334+ for i in ~ /* hestia* .deb; do
335+ # Install all available packages
336+ dpkg -i $i
337+ done
338+ unset $answer
339+ fi
0 commit comments