mirror of
https://github.com/quickemu-project/quickemu.git
synced 2024-06-03 05:25:32 +02:00
feat: add --header support to web_check()
This commit is contained in:
parent
02b93d9bbe
commit
0f69aeae9a
12
quickget
12
quickget
|
@ -1298,9 +1298,19 @@ function web_redirect() {
|
|||
|
||||
# checks if a URL is reachable
|
||||
function web_check() {
|
||||
local HEADERS=()
|
||||
local URL=""
|
||||
URL=$(web_redirect "${1}")
|
||||
curl --silent --location --head --output /dev/null --fail "${URL}"
|
||||
# Process any headers
|
||||
while (( "$#" )); do
|
||||
if [ "${1}" == "--header" ]; then
|
||||
HEADERS+=("${1}" "${2}")
|
||||
shift 2
|
||||
else
|
||||
shift
|
||||
fi
|
||||
done
|
||||
curl --silent --location --head --output /dev/null --fail "${HEADERS[@]}" "${URL}"
|
||||
}
|
||||
|
||||
function zsync_get() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user