Allow redirects for scripts

configs/releng/airootfs/root/.automated_script.sh:
Add the `--location` curl parameter (see `man 1 curl`) to allow for curl to retrieve a remote script even if the source
is being redirected (e.g. moved permanently) when using the `script=` kernel commandline parameter.

Fixes #113
This commit is contained in:
David Runge 2021-03-29 19:24:01 +02:00
parent d86f8606dc
commit 0664efcf3c
No known key found for this signature in database
GPG Key ID: 7258734B41C31549

View File

@ -16,7 +16,7 @@ automated_script ()
script="$(script_cmdline)" script="$(script_cmdline)"
if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then
if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then
curl "${script}" --retry-connrefused -s -o /tmp/startup_script >/dev/null curl "${script}" --location --retry-connrefused -s -o /tmp/startup_script >/dev/null
rt=$? rt=$?
else else
cp "${script}" /tmp/startup_script cp "${script}" /tmp/startup_script