Simplifying regex for script download

configs/releng/airootfs/root/.automated_script.sh:
Using only one regex to match http://, https:// or ftp:// endpoints.
This commit is contained in:
David Runge 2020-05-23 16:19:22 +02:00
parent 2ce375cd01
commit d50e57a243
No known key found for this signature in database
GPG Key ID: 7258734B41C31549

View File

@ -15,7 +15,7 @@ automated_script ()
local script rt local script rt
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:// || "${script}" =~ ^ftp:// ]]; then if [[ "${script}" =~ ^((http|https|ftp)://) ]]; then
wget "${script}" --retry-connrefused -q -O /tmp/startup_script >/dev/null wget "${script}" --retry-connrefused -q -O /tmp/startup_script >/dev/null
rt=$? rt=$?
else else