Skip to content

Commit c2290f0

Browse files
author
Kristan Kenney
committed
Merge branch 'bugfix-compiler' into develop
2 parents 40902cc + 8a5ea81 commit c2290f0

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

src/hst_autocompile.sh

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Autocompile Script for HestiaCP deb Files.
22

3+
# Clear previous screen output
4+
clear
5+
6+
# Define download function
7+
download_file() {
8+
wget $1 -q --show-progress --progress=bar:force
9+
}
10+
311
# Set compiling directory
412
BUILD_DIR='/tmp/hestiacp-src/'
513
DEB_DIR="$BUILD_DIR/debs/"
@@ -131,10 +139,10 @@ if [ "$NGINX_B" = true ] ; then
131139
mkdir $BUILD_DIR/hestia-nginx_$NGINX_V
132140

133141
# Download and unpack source files
134-
wget -qO- $NGINX | tar xz
135-
wget -qO- $OPENSSL | tar xz
136-
wget -qO- $PCRE | tar xz
137-
wget -qO- $ZLIB | tar xz
142+
download_file $NGINX | tar xz
143+
download_file $OPENSSL | tar xz
144+
download_file $PCRE | tar xz
145+
download_file $ZLIB | tar xz
138146

139147
# Change to nginx directory
140148
cd nginx-$NGINX_V
@@ -169,10 +177,10 @@ if [ "$NGINX_B" = true ] ; then
169177

170178
# Download control, postinst and postrm files
171179
cd DEBIAN
172-
wget $GIT_REP/nginx/control
173-
wget $GIT_REP/nginx/copyright
174-
wget $GIT_REP/nginx/postinst
175-
wget $GIT_REP/nginx/postrm
180+
download_file $GIT_REP/nginx/control
181+
download_file $GIT_REP/nginx/copyright
182+
download_file $GIT_REP/nginx/postinst
183+
download_file $GIT_REP/nginx/postrm
176184

177185
# Set permission
178186
chmod +x postinst postrm
@@ -183,13 +191,13 @@ if [ "$NGINX_B" = true ] ; then
183191

184192
# Get Service File
185193
cd etc/init.d
186-
wget $GIT_REP/nginx/hestia
194+
download_file $GIT_REP/nginx/hestia
187195
chmod +x hestia
188196

189197
# Get nginx.conf
190198
cd ../../
191199
rm usr/local/hestia/nginx/conf/nginx.conf
192-
wget $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
200+
download_file $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
193201

194202
# copy binary
195203
cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
@@ -226,7 +234,7 @@ if [ "$PHP_B" = true ] ; then
226234
mkdir ${BUILD_DIR}/hestia-php_$PHP_V
227235

228236
# Download and unpack source files
229-
wget -qO- $PHP | tar xz
237+
download_file $PHP | tar xz
230238

231239
# Change to php directory
232240
cd php-$PHP_V
@@ -254,18 +262,18 @@ if [ "$PHP_B" = true ] ; then
254262

255263
# Download control, postinst and postrm files
256264
cd DEBIAN
257-
wget $GIT_REP/php/control
258-
wget $GIT_REP/php/copyright
265+
download_file $GIT_REP/php/control
266+
download_file $GIT_REP/php/copyright
259267

260268
# Move php directory
261269
cd ..
262270
mv ${BUILD_DIR}/usr/local/hestia/php usr/local/hestia/
263271

264272
# Get php-fpm.conf
265-
wget $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
273+
download_file $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
266274

267275
# Get php.ini
268-
wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
276+
download_file $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
269277

270278
# copy binary
271279
cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
@@ -302,7 +310,7 @@ if [ "$HESTIA_B" = true ] ; then
302310
mkdir $BUILD_DIR/hestia_$HESTIA_V
303311

304312
# Download and unpack source files
305-
wget $HESTIA
313+
download_file $HESTIA
306314
unzip -q $branch.zip
307315
rm $branch.zip
308316

@@ -312,9 +320,9 @@ if [ "$HESTIA_B" = true ] ; then
312320

313321
# Download control, postinst and postrm files
314322
cd DEBIAN
315-
wget $GIT_REP/hestia/control
316-
wget $GIT_REP/hestia/copyright
317-
wget $GIT_REP/hestia/postinst
323+
download_file $GIT_REP/hestia/control
324+
download_file $GIT_REP/hestia/copyright
325+
download_file $GIT_REP/hestia/postinst
318326

319327
# Set permission
320328
chmod +x postinst

0 commit comments

Comments
 (0)