mirror of
https://github.com/LamGC/jenkins-agent-with-docker.git
synced 2026-01-12 20:30:44 +00:00
Improve update script with redirection support and robustness.
This commit is contained in:
@ -4,7 +4,7 @@ TEMP_JSON=$(mktemp)
|
|||||||
trap 'rm -f "$TEMP_JSON"' EXIT
|
trap 'rm -f "$TEMP_JSON"' EXIT
|
||||||
API_URL="https://api.github.com/repos/jenkinsci/docker-agent/releases/latest"
|
API_URL="https://api.github.com/repos/jenkinsci/docker-agent/releases/latest"
|
||||||
|
|
||||||
HTTP_CODE=$(curl -s -o "$TEMP_JSON" -w "%{http_code}" "$API_URL")
|
HTTP_CODE=$(curl -fsL -o "$TEMP_JSON" -w "%{http_code}" "$API_URL")
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error: Network request failed."
|
echo "Error: Network request failed."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user