0
0
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:
JunJian Zheng 2015-10-19 09:29:43 +08:00
parent 8582e0e7e2
commit 61cd568f81

6
bin/n
View File

@ -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
} }