2 # Copyright (C) Marvin Scholz
6 # Check if a given URL exists or not
9 # Print error message and terminate script with status 1
18 # Return the HTTP status code for a specific URL
25 HTTP_STATUS_CODE
=$
(curl
-s -o /dev
/null
-L -I -w "%{http_code}" "$1")
28 command -v "curl" >/dev
/null
2>&1 || abort_err
"cURL was not found!"
31 abort_err
"No URL to check provided!"
36 if [ "$HTTP_STATUS_CODE" -eq 200 ]; then
39 abort_err
"'$1' returned HTTP Status Code '$HTTP_STATUS_CODE'"