From 75e57093e617ce6f03b03168e54685cfff8e66d0 Mon Sep 17 00:00:00 2001 From: Dariusz Pelowski Date: Wed, 29 May 2024 13:21:41 +0200 Subject: .automated_script.sh: add proper HTTP status checking When a download attempt fails with an HTTP error, the body of the failed request will be written to the output file with a 0 exit status, causing the execution of an error message as a script. This issue is resolved by adding the --fail option to curl. Co-authored-by: David Runge --- configs/releng/airootfs/root/.automated_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/releng/airootfs') diff --git a/configs/releng/airootfs/root/.automated_script.sh b/configs/releng/airootfs/root/.automated_script.sh index 0d95012..f7f3ced 100755 --- a/configs/releng/airootfs/root/.automated_script.sh +++ b/configs/releng/airootfs/root/.automated_script.sh @@ -23,7 +23,7 @@ automated_script() { sleep 1 done printf '%s: downloading %s\n' "$0" "${script}" - curl "${script}" --location --retry-connrefused --retry 10 -s -o /tmp/startup_script + curl "${script}" --location --retry-connrefused --retry 10 --fail -s -o /tmp/startup_script rt=$? else cp "${script}" /tmp/startup_script -- cgit v1.2.3-70-g09d2