Skip to content

Commit fc95e89

Browse files
committed
Adjust compilation script.
1 parent 063fcf4 commit fc95e89

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

src/hst_autocompile.sh

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
BUILD_DIR='/root'
55
INSTALL_DIR='/usr/local/hestia'
66

7-
# Set git repository raw path
8-
GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/master/src/deb'
9-
107
# Set Version for compiling
118
HESTIA_V='0.9.8-28_amd64'
129
NGINX_V='1.15.10'
@@ -51,49 +48,34 @@ for arg; do
5148
--hestia)
5249
HESTIA_B='true'
5350
;;
54-
--install)
55-
answer='Y'
56-
;;
5751
*)
5852
NOARGUMENT='true'
5953
;;
6054
esac
6155
done
6256

63-
if [ ! "$1" = "--all" ] || [ ! "$1" = "--hestia" ] || [ ! "$1" = "--nginx" ] || [ ! "$1" = "--php" ]; then
57+
if [[ $# -eq 0 ]] ; then
6458
echo "(!) Invalid compilation flag specified. Valid flags:"
6559
echo "--all"
6660
echo "--hestia"
6761
echo "--nginx"
6862
echo "--php"
69-
echo ""
70-
echo "You may also specify --install to install the packages after compilation."
7163
exit 1
7264
fi
7365

74-
# If branch was specified at run-time, convert its value to the branch variable
75-
if [ "$3" ]; then
76-
branch=$3
77-
fi
66+
# Ask for branch
67+
echo -n "Please enter the name of the branch to build from (e.g. master): "
68+
read branch
7869

79-
# Prompt for Git branch to download and build from if not specified at run-time
80-
if [ ! $3 ]; then
81-
echo -n "Please enter the name of the branch to build from (e.g. master): "
82-
read branch
83-
fi
70+
# Ask if package should be installed after compilation
71+
echo -n 'Would you like to install the compiled packages? [y/N] '
72+
read INSTALL
8473

85-
if [[ $# -eq 0 ]] ; then
86-
echo "!!! Please run with argument --all, --hestia, --nginx or --php !!!"
87-
exit 1
88-
fi
89-
90-
if [ ! "$2" = "--install" ]; then
91-
echo -n 'Would you like to install the compiled packages? [Y/N] '
92-
read answer
93-
fi
74+
# Set git repository raw path
75+
GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
9476

9577
# Generate Links for sourcecode
96-
HESTIA='https://github.com/hestiacp/hestiacp/archive/$branch.zip'
78+
HESTIA='https://github.com/hestiacp/hestiacp/archive/'$branch'.zip'
9779
NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
9880
OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
9981
PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
@@ -331,10 +313,10 @@ fi
331313
#
332314
#################################################################################
333315

334-
if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
316+
if [ "$INSTALL" = 'y' ] || [ "$INSTALL" = 'Y' ]; then
335317
for i in ~/*hestia*.deb; do
336318
# Install all available packages
337319
dpkg -i $i
338320
done
339321
unset $answer
340-
fi
322+
fi

0 commit comments

Comments
 (0)