#!/bin/bash
URL=$1
if [[ -z "$URL" ]]; then
echo "Usage: $0 <url>"
exit 1
fi
HTTP_RESPONSE=$(curl -o /dev/null -s -w "%{http_code}\n" "$URL")
if [[ "$HTTP_RESPONSE" -eq 200 ]]; then
echo "The URL is accessible: $URL"
else
echo "The URL returned status code: $HTTP_RESPONSE"
fi