tools.func: replace max-time with speed-limit stall detection in curl_download (#14545)

* tools.func: replace max-time with speed-limit stall detection in curl_download

* Refactor curl_download function for improved readability and remove unnecessary whitespace
This commit is contained in:
CanbiZ (MickLesk)
2026-05-17 14:01:56 +02:00
committed by GitHub
parent 8f1c4a27a6
commit f7a69ac92d
12 changed files with 49 additions and 41 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ esac
msg_info "Installing Tomcat $TOMCAT_VERSION"
LATEST_VERSION=$(curl -fsSL "https://dlcdn.apache.org/tomcat/tomcat-$TOMCAT_VERSION/" | grep -oP 'v[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+)?/' | sort -V | tail -n 1 | sed 's/\/$//; s/v//')
TOMCAT_URL="https://dlcdn.apache.org/tomcat/tomcat-$TOMCAT_VERSION/v$LATEST_VERSION/bin/apache-tomcat-$LATEST_VERSION.tar.gz"
curl -fsSL "$TOMCAT_URL" -o "/tmp/tomcat.tar.gz"
curl_download "/tmp/tomcat.tar.gz" "$TOMCAT_URL"
mkdir -p /opt/tomcat-$TOMCAT_VERSION
tar --strip-components=1 -xzf /tmp/tomcat.tar.gz -C /opt/tomcat-$TOMCAT_VERSION
chown -R root:root /opt/tomcat-$TOMCAT_VERSION