only accept 200
This commit is contained in:
@@ -40,17 +40,13 @@ done
|
|||||||
output=""
|
output=""
|
||||||
for url in "${urls[@]}"; do
|
for url in "${urls[@]}"; do
|
||||||
#echo "curl -s ${options[@]} $url"
|
#echo "curl -s ${options[@]} $url"
|
||||||
output=$(eval "curl -s ${options[@]@Q} '$url'")
|
output=$(eval "curl -s ${options[@]@Q} '$url' --fail-with-body")
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
|
|
||||||
if cat "$temp_file" | jq -e 'has("error")' > /dev/null 2>&1; then
|
if cat "$temp_file" | jq -e 'has("error")' > /dev/null 2>&1; then
|
||||||
continue # Try the next URL
|
continue # Try the next URL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $output -ne 200 ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$original_output" ]; then
|
if [ -n "$original_output" ]; then
|
||||||
#echo "$(cat $temp_file)"
|
#echo "$(cat $temp_file)"
|
||||||
cat "$temp_file" > "$original_output"
|
cat "$temp_file" > "$original_output"
|
||||||
|
|||||||
Reference in New Issue
Block a user