mirror of
https://github.com/tj/n.git
synced 2024-11-29 21:56:16 +01:00
3xx and 2xx
This commit is contained in:
parent
8582e0e7e2
commit
61cd568f81
6
bin/n
6
bin/n
@ -362,13 +362,13 @@ is_ok() {
|
|||||||
if $GET -Is $1 | head -n 1 | grep '3..' > /dev/null; then
|
if $GET -Is $1 | head -n 1 | grep '3..' > /dev/null; then
|
||||||
is_ok $GET -Is $1 | grep Location | awk -F ': ' '{print $2}'
|
is_ok $GET -Is $1 | grep Location | awk -F ': ' '{print $2}'
|
||||||
else
|
else
|
||||||
$GET -Is $1 | head -n 1 | grep 200 > /dev/null
|
$GET -Is $1 | head -n 1 | grep '2..' > /dev/null
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if $GET -S --spider 2>&1 $1 | head -n 1 | grep 200 > /dev/null; then
|
if $GET -S --spider 2>&1 $1 | head -n 1 | grep '3..' > /dev/null; then
|
||||||
is_ok $GET -S --spider 2>&1 $1 | grep Location | awk -F ': ' '{print $2}'
|
is_ok $GET -S --spider 2>&1 $1 | grep Location | awk -F ': ' '{print $2}'
|
||||||
else
|
else
|
||||||
$GET -S --spider 2>&1 $1 | head -n 1 | grep 200 > /dev/null
|
$GET -S --spider 2>&1 $1 | head -n 1 | grep '2..' > /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user