Another POSIX fix

master
Aaron Johnson 4 years ago
parent 5ea82e37ef
commit 5280d0cfc4

@ -46,7 +46,7 @@ send_message() {
}
get_http_code() {
if host $(printf '%s\n' $1 | awk '{gsub("https?://|/.*","")}1') &>/dev/null; then
if host $(printf '%s\n' $1 | awk '{gsub("https?://|/.*","")}1') 2>&1 >/dev/null; then
curl -sILk --max-time $TIME $1 | grep HTTP | tail -n 1 | grep -Eo '[0-9]{3}' || printf '%s\n' 999
else
printf '%s\n' 000

Loading…
Cancel
Save