288288
289289# Generate Links for sourcecode
290290HESTIA_ARCHIVE_LINK=' https://github.com/hestiacp/hestiacp/archive/' $branch ' .tar.gz'
291- NGINX=' https://nginx.org/download/nginx-' $( echo $NGINX_V | cut -d" ~" -f1) ' .tar.gz'
291+ if [[ $NGINX_V =~ - ]]; then
292+ NGINX=' https://nginx.org/download/nginx-' $( echo $NGINX_V | cut -d" -" -f1) ' .tar.gz'
293+ else
294+ NGINX=' https://nginx.org/download/nginx-' $( echo $NGINX_V | cut -d" ~" -f1) ' .tar.gz'
295+ fi
292296OPENSSL=' https://www.openssl.org/source/openssl-' $OPENSSL_V ' .tar.gz'
293297PCRE=' https://github.com/PhilipHazel/pcre2/releases/download/pcre2-' $PCRE_V ' /pcre2-' $PCRE_V ' .tar.gz'
294298ZLIB=' https://www.zlib.net/zlib-' $ZLIB_V ' .tar.gz'
295- PHP=' http://de2.php.net/distributions/php-' $( echo $PHP_V | cut -d" ~" -f1) ' .tar.gz'
299+ if [[ $PHP_V =~ - ]]; then
300+ PHP=' http://de2.php.net/distributions/php-' $( echo $PHP_V | cut -d" -" -f1) ' .tar.gz'
301+ else
302+ PHP=' http://de2.php.net/distributions/php-' $( echo $PHP_V | cut -d" ~" -f1) ' .tar.gz'
303+ fi
296304
297305# Forward slashes in branchname are replaced with dashes to match foldername in github archive.
298306branch_dash=$( echo " $branch " | sed ' s/\//-/g' ) ;
@@ -313,8 +321,12 @@ if [ "$NGINX_B" = true ] ; then
313321 cd $BUILD_DIR
314322
315323 BUILD_DIR_HESTIANGINX=$BUILD_DIR /hestia-nginx_$NGINX_V
316- BUILD_DIR_NGINX=$BUILD_DIR /nginx-$( echo $NGINX_V | cut -d" ~" -f1)
317-
324+ if [[ $NGINX_V =~ - ]]; then
325+ BUILD_DIR_NGINX=$BUILD_DIR /nginx-$( echo $NGINX_V | cut -d" -" -f1)
326+ else
327+ BUILD_DIR_NGINX=$BUILD_DIR /nginx-$( echo $NGINX_V | cut -d" ~" -f1)
328+ fi
329+
318330 if [ " $KEEPBUILD " != ' true' ] || [ ! -d " $BUILD_DIR_HESTIANGINX " ]; then
319331 # Check if target directory exist
320332 if [ -d " $BUILD_DIR_HESTIANGINX " ]; then
@@ -456,8 +468,15 @@ if [ "$PHP_B" = true ] ; then
456468 echo " Building hestia-php package..."
457469
458470 BUILD_DIR_HESTIAPHP=$BUILD_DIR /hestia-php_$PHP_V
471+
459472 BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" ~" -f1)
460-
473+
474+ if [[ $PHP_V =~ - ]]; then
475+ BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" -" -f1)
476+ else
477+ BUILD_DIR_PHP=$BUILD_DIR /php-$( echo $PHP_V | cut -d" ~" -f1)
478+ fi
479+
461480 if [ " $KEEPBUILD " != ' true' ] || [ ! -d " $BUILD_DIR_HESTIAPHP " ]; then
462481 # Check if target directory exist
463482 if [ -d $BUILD_DIR_HESTIAPHP ]; then
0 commit comments