Created
March 22, 2023 20:45
-
-
Save angelbladex/b8dcf7a32b8e18050154b72db5911e9d to your computer and use it in GitHub Desktop.
Check page using HTTPie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Other version for check page, using HTTPie | |
#previous version (using wget) >https://gist.github.com/angelbladex/dad9308bbdb7e18f384a | |
# HTTPie https://httpie.io/ | |
function validate_url(){ | |
if [[ `http -h $1 --verify no 2>&1 --timeout 20 | grep -E '200|320|302'` ]]; then | |
echo "URL exist" | |
else | |
echo "Error detected. Check URL or internet connection" | |
fi | |
exit | |
} | |
if [[ ! -n "$1" ]]; then | |
echo "URL missing" | |
exit | |
fi | |
validate_url "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment