Quellcode durchsuchen

Merge branch 'bugfix-compiler' into develop

Kristan Kenney vor 7 Jahren
Ursprung
Commit
c2290f0b33
1 geänderte Dateien mit 27 neuen und 19 gelöschten Zeilen
  1. 27 19
      src/hst_autocompile.sh

+ 27 - 19
src/hst_autocompile.sh

@@ -1,5 +1,13 @@
 # Autocompile Script for HestiaCP deb Files.
 # Autocompile Script for HestiaCP deb Files.
 
 
+# Clear previous screen output
+clear
+
+# Define download function
+download_file() {
+  wget $1 -q --show-progress --progress=bar:force
+}
+
 # Set compiling directory
 # Set compiling directory
 BUILD_DIR='/tmp/hestiacp-src/'
 BUILD_DIR='/tmp/hestiacp-src/'
 DEB_DIR="$BUILD_DIR/debs/"
 DEB_DIR="$BUILD_DIR/debs/"
@@ -131,10 +139,10 @@ if [ "$NGINX_B" = true ] ; then
     mkdir $BUILD_DIR/hestia-nginx_$NGINX_V
     mkdir $BUILD_DIR/hestia-nginx_$NGINX_V
 
 
     # Download and unpack source files
     # Download and unpack source files
-    wget -qO- $NGINX | tar xz
-    wget -qO- $OPENSSL | tar xz
-    wget -qO- $PCRE | tar xz
-    wget -qO- $ZLIB | tar xz
+    download_file $NGINX | tar xz
+    download_file $OPENSSL | tar xz
+    download_file $PCRE | tar xz
+    download_file $ZLIB | tar xz
 
 
     # Change to nginx directory
     # Change to nginx directory
     cd nginx-$NGINX_V
     cd nginx-$NGINX_V
@@ -169,10 +177,10 @@ if [ "$NGINX_B" = true ] ; then
 
 
     # Download control, postinst and postrm files
     # Download control, postinst and postrm files
     cd DEBIAN
     cd DEBIAN
-    wget $GIT_REP/nginx/control
-    wget $GIT_REP/nginx/copyright
-    wget $GIT_REP/nginx/postinst
-    wget $GIT_REP/nginx/postrm
+    download_file $GIT_REP/nginx/control
+    download_file $GIT_REP/nginx/copyright
+    download_file $GIT_REP/nginx/postinst
+    download_file $GIT_REP/nginx/postrm
 
 
     # Set permission
     # Set permission
     chmod +x postinst postrm
     chmod +x postinst postrm
@@ -183,13 +191,13 @@ if [ "$NGINX_B" = true ] ; then
 
 
     # Get Service File
     # Get Service File
     cd etc/init.d
     cd etc/init.d
-    wget $GIT_REP/nginx/hestia
+    download_file $GIT_REP/nginx/hestia
     chmod +x hestia
     chmod +x hestia
 
 
     # Get nginx.conf
     # Get nginx.conf
     cd ../../
     cd ../../
     rm usr/local/hestia/nginx/conf/nginx.conf
     rm usr/local/hestia/nginx/conf/nginx.conf
-    wget $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
+    download_file $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
 
 
     # copy binary
     # copy binary
     cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
     cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
@@ -226,7 +234,7 @@ if [ "$PHP_B" = true ] ; then
     mkdir ${BUILD_DIR}/hestia-php_$PHP_V
     mkdir ${BUILD_DIR}/hestia-php_$PHP_V
 
 
     # Download and unpack source files
     # Download and unpack source files
-    wget -qO- $PHP | tar xz
+    download_file $PHP | tar xz
 
 
     # Change to php directory
     # Change to php directory
     cd php-$PHP_V
     cd php-$PHP_V
@@ -254,18 +262,18 @@ if [ "$PHP_B" = true ] ; then
 
 
     # Download control, postinst and postrm files
     # Download control, postinst and postrm files
     cd DEBIAN
     cd DEBIAN
-    wget $GIT_REP/php/control
-    wget $GIT_REP/php/copyright
+    download_file $GIT_REP/php/control
+    download_file $GIT_REP/php/copyright
 
 
     # Move php directory
     # Move php directory
     cd ..
     cd ..
     mv ${BUILD_DIR}/usr/local/hestia/php usr/local/hestia/
     mv ${BUILD_DIR}/usr/local/hestia/php usr/local/hestia/
 
 
     # Get php-fpm.conf
     # Get php-fpm.conf
-    wget $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
+    download_file $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
 
 
     # Get php.ini
     # Get php.ini
-    wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
+    download_file $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
 
 
     # copy binary
     # copy binary
     cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
     cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
@@ -302,7 +310,7 @@ if [ "$HESTIA_B" = true ] ; then
     mkdir $BUILD_DIR/hestia_$HESTIA_V
     mkdir $BUILD_DIR/hestia_$HESTIA_V
 
 
     # Download and unpack source files
     # Download and unpack source files
-    wget $HESTIA
+    download_file $HESTIA
     unzip -q $branch.zip
     unzip -q $branch.zip
     rm $branch.zip
     rm $branch.zip
 
 
@@ -312,9 +320,9 @@ if [ "$HESTIA_B" = true ] ; then
 
 
     # Download control, postinst and postrm files
     # Download control, postinst and postrm files
     cd DEBIAN
     cd DEBIAN
-    wget $GIT_REP/hestia/control
-    wget $GIT_REP/hestia/copyright
-    wget $GIT_REP/hestia/postinst
+    download_file $GIT_REP/hestia/control
+    download_file $GIT_REP/hestia/copyright
+    download_file $GIT_REP/hestia/postinst
 
 
     # Set permission
     # Set permission
     chmod +x postinst
     chmod +x postinst