diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..93f51704f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,40 @@ +# EditorConfig https://editorconfig.org +root = true + +# Default settings for all files +[*] +indent_style = tab +indent_size = 4 +tab_width = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{js,py}] +charset = utf-8 + +[*.sh] +indent_style = tab +indent_size = 4 +tab_width = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# Override JSON +[*.json] +indent_style = space +indent_size = 2 +tab_width = 2 + +# Override YAML +[*.yml] +indent_style = space +indent_size = 2 +tab_width = 2 + +[*.html] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 diff --git a/apothecary/apothecary b/apothecary/apothecary index 952283ae6..e41d08ba1 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -1546,7 +1546,7 @@ function frameworkFormula() { fi export XLIBS_DIR_REAL=$(realpath $XLIBSLOCAL) - if [[ $TYPE == "osx" ]]; then + if [[ $TYPE == "osx" ]]; then TYPE_OUT="macos" else TYPE_OUT=${TYPE} @@ -1564,15 +1564,19 @@ function frameworkFormula() { xcframework_flags="" XDIR="${XLIBS_DIR_REAL}/" - X_LIBS="$XDIR/${1}/lib/${TYPE_OUT}/" - X_INCLUDE=$XDIR/${1}/include - X_LICENSE=$XDIR/${1}/license + X_LIBS="${XDIR}/${1}/lib/${TYPE_OUT}/" + X_INCLUDE=${XDIR}/${1}/include + X_LICENSE=${XDIR}/${1}/license mkdir -p "${X_INCLUDE}" mkdir -p "${X_LICENSE}" + mkdir -p "${X_LIBS}" if [[ $1 == "fmod" ]] || [[ $1 == "fmodex" ]] || [[ $1 == "glm" ]] || [[ $1 == "json" ]] || [[ $1 == "utf8" ]]; then - if ! command -v rsync &> /dev/null; then + if [[ $TYPE == "macos" ]]; then + TYPE_OUT="osx" + fi + if ! command -v rsync &> /dev/null; then if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/" ]]; then mkdir -p "${X_LIBS}" cp -av "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/"* ${X_LIBS} @@ -1585,19 +1589,20 @@ function frameworkFormula() { fi else if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${TYPE}" ]]; then + echo "Copying from ${LIBS_DIR_REAL}/${1}/lib/${TYPE}/ to ${X_LIBS}" mkdir -p "${X_LIBS}" - rsync -av --delete "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/" ${X_LIBS} + rsync -av "${LIBS_DIR_REAL}/${1}/lib/${TYPE}/" ${X_LIBS} fi if [[ -e "${LIBS_DIR_REAL}/${1}/include/" ]]; then - rsync -av --delete "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} + rsync -av "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} fi if [[ -e "${LIBS_DIR_REAL}/${1}/license/" ]]; then - rsync -av --delete "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} + rsync -av "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} fi fi exit 0; fi - mkdir -p "${X_LIBS}" + if ((BASH_VERSINFO[0] < 4)); then echo "The current version of Bash does not support associative arrays." echo "Please update to Bash 4.0 or newer. Current:${BASH_VERSINFO[0]}" @@ -1788,9 +1793,9 @@ function frameworkFormula() { cp -av "${LIBS_DIR_REAL}/${1}/include/"* ${X_INCLUDE} cp -av "${LIBS_DIR_REAL}/${1}/license/"* ${X_LICENSE} else - rsync -av --delete "${XCFRAMEWORK_PATH}" ${X_LIBS} - rsync -av --delete "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} - rsync -av --delete "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} + rsync -av "${XCFRAMEWORK_PATH}" ${X_LIBS} + rsync -av "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} + rsync -av "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} fi echo " -- cleanup merged libraries ..." @@ -1844,13 +1849,22 @@ function xframeworkFormula() { xcframework_flags="" XDIR="${XLIBS_DIR_REAL}/" - X_LIBS="$XDIR/${1}/lib/${X_TYPE}/" - X_INCLUDE=$XDIR/${1}/include - X_LICENSE=$XDIR/${1}/license + X_LIBS="${XDIR}/${1}/lib/${X_TYPE}/" + X_INCLUDE=${XDIR}/${1}/include + X_LICENSE=${XDIR}/${1}/license mkdir -p "${X_INCLUDE}" mkdir -p "${X_LICENSE}" + mkdir -p "${X_LIBS}" + if [[ $TYPE == "macos" ]]; then + echoSuccess "Building macOS xcframework" + fi + + if [[ $1 == "fmod" ]] || [[ $1 == "fmodex" ]]; then + X_TYPE=osx + fi + if [[ $1 == "fmod" ]] || [[ $1 == "fmodex" ]] || [[ $1 == "glm" ]] || [[ $1 == "json" ]] || [[ $1 == "utf8" ]]; then if ! command -v rsync &> /dev/null; then if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}/" ]]; then @@ -1865,22 +1879,20 @@ function xframeworkFormula() { fi else if [[ -e "${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}" ]]; then + echo "Copying from ${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}/ to ${X_LIBS}" mkdir -p "${X_LIBS}" - rsync -av --delete "${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}/" ${X_LIBS} + rsync -av "${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}/" ${X_LIBS} fi if [[ -e "${LIBS_DIR_REAL}/${1}/include/" ]]; then - rsync -av --delete "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} + rsync -av "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} fi if [[ -e "${LIBS_DIR_REAL}/${1}/license/" ]]; then - rsync -av --delete "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} + rsync -av "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} fi fi exit 0; fi - mkdir -p "${X_LIBS}" - if [[ $TYPE == "macos" ]]; then - echoSuccess "Building macOS xcframework" - fi + XCFRAMEWORK_PATH="${LIBS_DIR_REAL}/${1}/lib/${X_TYPE}/$1.xcframework" @@ -2062,9 +2074,9 @@ function xframeworkFormula() { cp -av "${LIBS_DIR_REAL}/${1}/include/"* ${X_INCLUDE} cp -av "${LIBS_DIR_REAL}/${1}/license/"* ${X_LICENSE} else - rsync -av --delete "${XCFRAMEWORK_PATH}" ${X_LIBS} - rsync -av --delete "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} - rsync -av --delete "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} + rsync -av "${XCFRAMEWORK_PATH}" ${X_LIBS} + rsync -av "${LIBS_DIR_REAL}/${1}/include/" ${X_INCLUDE} + rsync -av "${LIBS_DIR_REAL}/${1}/license/" ${X_LICENSE} fi echo " -- cleanup merged libraries ..." diff --git a/scripts/downloader.sh b/scripts/downloader.sh index 9c309740c..341200c82 100755 --- a/scripts/downloader.sh +++ b/scripts/downloader.sh @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=4.2.4 +VERSION=4.3.1 printDownloaderHelp(){ cat << EOF @@ -56,14 +56,14 @@ CON_YELLOW="\033[33m" CON_YELLOW_GREEN="\033[33m" CON_GREEN="\033[32m" -echoError() { - echo -e "$CON_BOLD$CON_RED$1$CON_DEFAULT" +echoError() { + echo -e "$CON_BOLD$CON_RED$1$CON_DEFAULT" } -echoWarning() { - echo -e "$CON_BOLD$CON_YELLOW$1$CON_DEFAULT" +echoWarning() { + echo -e "$CON_BOLD$CON_YELLOW$1$CON_DEFAULT" } -echoInfo() { - echo -e "$CON_BOLD$CON_WHITE$1$CON_DEFAULT" +echoInfo() { + echo -e "$CON_BOLD$CON_WHITE$1$CON_DEFAULT" } check_remote_vs_local() { @@ -80,6 +80,7 @@ check_remote_vs_local() { echo " [downloader] Found download cache." echo " [cache] [$LOCAL_FILE]" fi + REMOTE_URL=$(echo "$REMOTE_URL" | sed 's/[[:space:]]*$//') LocalSize=$(wc -c < "$LOCAL_FILE" | tr -d '[:space:]') #REMOTE_CALL="wget2 --spider --max-redirect=${MAX_REDIRECTS} ${EXTRA_ARGS}" REMOTE_CALL="" @@ -90,11 +91,12 @@ check_remote_vs_local() { RemoteSizeMB=$(convert_bytes_to_mb $RemoteSize) echo " [downloader] Remote size:[${RemoteSizeMB}] | Local size:[${LocalSizeMB}]" - if [ -z "$modified" ]; then - echo " [downloader] failed to retrieve last-modified header from remote ["$REMOTE_URL"] ... Proceeding with download" - CHECK_RESULT=0 - return - fi + if [ -z "$modified" ]; then + echo " [downloader] failed to retrieve last-modified header from remote ["$REMOTE_URL"] ... Proceeding with download" + CHECK_RESULT=0 + rm -f $LOCAL_FILE + return + fi if [[ "$OSTYPE" == "darwin"* ]]; then remote_ctime=$(date -j -f "%a, %d %b %Y %H:%M:%S %Z" "$modified" "+%s" 2>/dev/null) else @@ -104,34 +106,38 @@ check_remote_vs_local() { echo " [downloader] Error in converting Remote modification time [report this openFrameworks devs]." echo " [downloader] ... Proceeding with download" CHECK_RESULT=0 + rm -f $LOCAL_FILE return fi - if [[ "$OSTYPE" == "darwin"* ]]; then # Get local file modification time - local_ctime=$(stat -f "%Sm" -t "%a, %d %b %Y %H:%M:%S %Z" "$LOCAL_FILE" 2>/dev/null) - local_ctime=$(date -j -f "%a, %d %b %Y %H:%M:%S %Z" "$local_ctime" "+%s" 2>/dev/null) - else - local_ctime=$(stat -c %y "$LOCAL_FILE" 2>/dev/null) - local_ctime=$(date --date="$local_ctime" +%s 2>/dev/null) - fi + if [[ "$OSTYPE" == "darwin"* ]]; then # Get local file modification time + local_ctime=$(stat -f "%Sm" -t "%a, %d %b %Y %H:%M:%S %Z" "$LOCAL_FILE" 2>/dev/null) + local_ctime=$(date -j -f "%a, %d %b %Y %H:%M:%S %Z" "$local_ctime" "+%s" 2>/dev/null) + else + local_ctime=$(stat -c %y "$LOCAL_FILE" 2>/dev/null) + local_ctime=$(date --date="$local_ctime" +%s 2>/dev/null) + fi if [ $? -ne 0 ]; then echo " [downloader] Error in converting Local modification time [report this openFrameworks devs]." echo " [downloader] ... Proceeding with download" CHECK_RESULT=0 + rm -f $LOCAL_FILE return fi if [ "$LocalSize" != "$RemoteSize" ]; then - echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]" + echo " [downloader] Remote size bits:[${RemoteSize}] | Local size bits:[${LocalSize}]" echo " [downloader] File sizes differ between remote and local file." echo " [downloader] ... Proceeding with download" CHECK_RESULT=0 + rm -f $LOCAL_FILE return fi if [ "$local_ctime" -lt "$remote_ctime" ]; then - echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]" + echo " [downloader] Remote modification Time:[${remote_ctime}] | Local modification Time:[${local_ctime}]" echo " [downloader] Remote file is newer." echo " [downloader] ... Proceeding with download" CHECK_RESULT=0 + rm -f $LOCAL_FILE return fi echo " [downloader] No need to download again. Every bit matters." @@ -140,7 +146,9 @@ check_remote_vs_local() { } finalurl() { - curl --silent --location --head --output /dev/null --write-out '%{url_effective}' -- "$@" + F_URL=$(echo "$@" | sed 's/[[:space:]]*$//') + # echo "finalurl: [$@] - F_URL:[$F_URL]" + curl -L -I --retry ${RETRY_MAX} --max-redirs ${MAX_REDIRECTS} --retry-connrefused --silent --location --head --output /dev/null --write-out '%{url_effective}' -- "$F_URL" } downloader() { @@ -154,7 +162,7 @@ downloader() { NO_SSL=0 COMPRESSION=1 VERBOSE=0 - WGET2=1 + WGET2=0 CURL=1 WGET=1 CLOSE_CONNECTION=1 @@ -225,6 +233,11 @@ downloader() { ;; esac done + if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* || "$OSTYPE" == "win32"* ]]; then + echo "Detected Windows OS. Skipping wget2..." + WGET2=0 + WGET2_INSTALLED=0 + fi # [wget2] if command -v wget2 > /dev/null 2>&1; then WGET2_INSTALLED=1 @@ -251,15 +264,21 @@ downloader() { CURL_VERSION=$(curl -V | head -n 1 | awk '{print $2}') CURL_MIN=7.71.0 if [ "$(printf '%s\n' "$CURL_MIN" "$CURL_VERSION" | sort -V | head -n1)" = "$CURL_MIN" ] && [ "$CURL_VERSION" != "$CURL_MIN" ]; then - if [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 ]]; then - EXTRA_ARGS+="--retry-all-errors " - fi + if [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 ]]; then + EXTRA_ARGS+="--retry-all-errors " + fi fi CURL_MIN=7.83.0 if [ "$(printf '%s\n' "$CURL_MIN" "$CURL_VERSION" | sort -V | head -n1)" = "$CURL_MIN" ] && [ "$CURL_VERSION" != "$CURL_MIN" ]; then - if [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 ]]; then - EXTRA_ARGS+="--remove-on-error " - fi + if [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 ]]; then + EXTRA_ARGS+="--remove-on-error " + fi + fi + if curl -V | grep -q 'HTTP2'; then + CURL_SUPPORTS_HTTP2=1 + CLOSE_CONNECTION=0 + else + CURL_SUPPORTS_HTTP2=0 fi if [[ "$COMPRESSION" == "1" ]] && [[ $CURL == 1 ]] && [[ $WGET2 == 0 || $WGET2_INSTALLED == 0 ]]; then if curl -V | grep -q "brotli"; then @@ -289,7 +308,7 @@ downloader() { if [[ "$COMPRESSION" == "1" ]]; then echo " [downloader] enabled brotli/zlib losslesss compression response" elif [[ "$COMPRESSION" == "0" ]] && [[ $CURL == 1 && $CURL_INSTALLED == 1 ]] && [[ $WGET2 == 0 || $WGET2_INSTALLED == 0 ]]; then - EXTRA_ARGS+="-Z " + EXTRA_ARGS+="-Z " fi if [[ "$NO_SSL" == "1" ]]; then if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]] || [[ $WGET == 1 && $WGET_INSTALLED == 1 && $CURL == 0 ]]; then @@ -315,8 +334,8 @@ downloader() { LOCAL_FILE=$FILENAME REMOTE_URL=$URL FORWARDED=$(finalurl "$URL") - FORWARDED_URLS+=($FORWARDED) - FINAL_URLS+="$FORWARDED" + FORWARDED_URLS+=($FORWARDED) + FINAL_URLS+="$FORWARDED" check_remote_vs_local "$LOCAL_FILE" "$REMOTE_URL" 1 if [ $CHECK_RESULT -eq 0 ]; then URLS_TO_DOWNLOAD+="${URL}" @@ -331,7 +350,7 @@ downloader() { LOCAL_FILE=$FILENAME REMOTE_URL=$URL if validate_url "$URL"; then - FORWARDED=$(finalurl "$URL") + FORWARDED=$(finalurl "$URL") FORWARDED_URLS+=($FORWARDED) FINAL_URLS+="$FORWARDED" check_remote_vs_local "$LOCAL_FILE" "$REMOTE_URL" 0 @@ -354,12 +373,11 @@ downloader() { CONNECTION_EXTRA_ARGS=("Connection: close") if [[ "$CLOSE_CONNECTION" == "0" ]]; then - CONNECTION_EXTRA_ARGS="" + CONNECTION_EXTRA_ARGS="" fi if [[ $VERBOSE == 1 ]]; then EXTRA_ARGS+=" --verbose " - #-w "\n[%{url_effective}]\n\nDownload Size:[%{size_download}B] in Time total:[%{time_total}s] DL speed:[%{speed_download}B/s] - Time in redirects:[%{time_redirect}s]" fi EXTRA_ARGS=$(echo "$EXTRA_ARGS" | sed 's/[[:space:]]*$//') FINAL_EXTRA_ARGS=$(echo "$FINAL_EXTRA_ARGS" | sed 's/[[:space:]]*$//') @@ -371,31 +389,31 @@ downloader() { if [[ "${SILENT}" == 1 ]]; then if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then echo - wget2 -N -nv --progress=bar --tries=${RETRY_MAX} --max-redirect=${MAX_REDIRECTS} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} + wget2 -N -nv --progress=bar --tries=${RETRY_MAX} --max-redirect=${MAX_REDIRECTS} --retry-connrefused --timeout=1500 --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} elif [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]]; then echo curl -Z -L --silent --retry ${RETRY_MAX} --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} --header "Connection: close" --progress-bar ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} elif [[ $WGET == 1 ]] && [[ $WGET_INSTALLED == 1 ]]; then echo - wget -nv -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} "${CONNECTION_EXTRA_ARGS[@]}" ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} + wget -nv -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} else echo $ERROR_MSG; exit 1; fi; else if [[ $WGET2 == 1 ]] && [[ $WGET2_INSTALLED == 1 ]]; then - echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]" + echo " [downloader] [wget2] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS" echo - wget2 -N -c --progress=bar --force-progress --tries=${RETRY_MAX} --max-redirect=${MAX_REDIRECTS} --retry-connrefused --waitretry=${RETRY_DELAY_S} --timeout=500 ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} + wget2 -N -c --progress=bar --force-progress --tries=${RETRY_MAX} --max-redirect=${MAX_REDIRECTS} --retry-connrefused --waitretry=${RETRY_DELAY_S} --timeout=1500 ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} elif [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]]; then echo " [downloader] [cURL] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]" echo curl -Z -L --retry ${RETRY_MAX} --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} --progress-bar --header "Connection: close" ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} elif [[ $WGET == 1 ]] && [[ $WGET_INSTALLED == 1 ]]; then - echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS ${CONNECTION_EXTRA_ARGS[@]}]" + echo " [downloader] [wget] [$FILENAME] urls:[$URLS_TO_DOWNLOAD] args:[$EXTRA_ARGS $FINAL_EXTRA_ARGS]" echo - wget -nv --progress=bar -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} --header "Connection: close" ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} + wget -nv --progress=bar -N --tries=${RETRY_MAX} --retry-connrefused --waitretry=${RETRY_DELAY_S} ${EXTRA_ARGS} ${FINAL_EXTRA_ARGS} ${URLS_TO_DOWNLOAD} else echo $ERROR_MSG; exit 1; @@ -404,16 +422,17 @@ downloader() { fi if [[ "$CLOSE_CONNECTION" == "1" ]]; then - if [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]] || [[ $CURL == 1 && $WGET2 == 1 ]]; then - FIRST_URL=$FORWARDED_URLS[1] - if [[ ${#FORWARDED_URLS[@]} -eq 0 ]]; then + if [[ $CURL == 1 ]] && [[ $CURL_INSTALLED == 1 ]] || [[ $CURL == 1 && $WGET2 == 1 ]]; then + FIRST_URL=$FORWARDED_URLS[1] + if [[ ${#FORWARDED_URLS[@]} -eq 0 ]]; then echo " [downloader] No active connections to close" else FIRST_URL="${FORWARDED_URLS[0]}" + FIRST_URL=$(echo "$FIRST_URL" | sed 's/[[:space:]]*$//') echo " [downloader] Closing the ports yarr url:[$FIRST_URL]" - curl -I -L --retry-connrefused --insecure --silent --head --max-time 1 --verbose --retry ${RETRY_MAX} ${CLOSE_EXTRA_ARGS} --no-keepalive --header "Connection: close" --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} ${FIRST_URL} - fi - fi + curl -I -L --retry-connrefused --insecure --silent --head --max-time 1 --retry ${RETRY_MAX} ${CLOSE_EXTRA_ARGS} --no-keepalive --header "Connection: close" --retry-delay ${RETRY_DELAY_S} --max-redirs ${MAX_REDIRECTS} ${FIRST_URL} + fi + fi fi } diff --git a/scripts/format.sh b/scripts/format.sh old mode 100644 new mode 100755