Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (17 sloc) 631 Bytes
#!/bin/bash
address=$1
timeout=5
response=$(curl -m $timeout -sk --write-out %{http_code} --silent --output /dev/null http://$address)
badtitles="Authorization Required|Index of|Error|Site Temporarily Unavailable"
if [ $response != "200" ]; then
address=$(curl -m $timeout --write-out %{url_effective} -sk --silent --output /dev/null -L http://$address)
fi
title=`curl -m $timeout -sk $address | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q'`
if [ "$title" != "" ]; then
ignore_address=`echo $title | grep -i -E "$badtitles" | wc -l | sed 's/ //g'`
if [ $ignore_address == 0 ]; then
echo $title
fi
else
echo "$1"
fi
Jump to Line
Something went wrong with that request. Please try again.