Skip to content

Instantly share code, notes, and snippets.

@chixq
Last active September 4, 2015 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chixq/eb1f1f0d898a36600e7f to your computer and use it in GitHub Desktop.
Save chixq/eb1f1f0d898a36600e7f to your computer and use it in GitHub Desktop.
verify site accessibility
wget -q --tries=2 --timeout=5 --spider $1|| echo "unaccessible";
#!/bin/bash
isAccessible ()
{
if [ "x$1" == "x" ]; then
return 1
fi
accessible=0
curl -s --head --retry 2 --retry-delay 1 -m 10 $1 -o /dev/null || accessible=1
return ${accessible}
}
isAccessible ssssssssbaidu.com
if [ $? == 1 ];then
echo "not accessible"
else
echo "accesible"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment