Commit 03b2424f authored by tom's avatar tom

[skip ci] add timeout for asset download script

parent 540d95ee
...@@ -87,8 +87,11 @@ download_and_save_asset() { ...@@ -87,8 +87,11 @@ download_and_save_asset() {
else else
# Check if the value is a URL # Check if the value is a URL
if [[ "$url" == http* ]]; then if [[ "$url" == http* ]]; then
# Download the asset using curl # Download the asset using curl with timeouts
curl -s -o "$destination" "$url" if ! curl -f -s --connect-timeout 5 --max-time 15 -o "$destination" "$url"; then
echo " [-] $env_var: Failed to download from $url (timeout or connection error)"
return 1
fi
else else
# Convert single-quoted JSON-like content to valid JSON # Convert single-quoted JSON-like content to valid JSON
json_content=$(echo "${!env_var}" | sed "s/'/\"/g") json_content=$(echo "${!env_var}" | sed "s/'/\"/g")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment