mirror of
https://github.com/tj/n.git
synced 2024-11-29 13:52:34 +01:00
Update n
This commit is contained in:
parent
1388dd0926
commit
8582e0e7e2
8
bin/n
8
bin/n
@ -359,10 +359,18 @@ erase_line() {
|
||||
|
||||
is_ok() {
|
||||
if command -v curl > /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}'
|
||||
else
|
||||
$GET -Is $1 | head -n 1 | grep 200 > /dev/null
|
||||
fi
|
||||
else
|
||||
if $GET -S --spider 2>&1 $1 | head -n 1 | grep 200 > /dev/null; then
|
||||
is_ok $GET -S --spider 2>&1 $1 | grep Location | awk -F ': ' '{print $2}'
|
||||
else
|
||||
$GET -S --spider 2>&1 $1 | head -n 1 | grep 200 > /dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user