#!/usr/bin/env bash


input_file="urls.txt"

while IFS= read -r url; do
  # Skip empty lines or comments
  [[ -z "$url" || "$url" =~ ^# ]] && continue

  status=$(curl -s -o /dev/null -w "%{http_code}" "$url")
  if [[ $status == 2* ]]; then
        color="\033[0;32m" # green
    elif [[ $status == 3* ]]; then
        color="\033[0;33m" # yellow
    else
        color="\033[0;31m" # red
    fi
    echo -e "${color}$url => $status\033[0m"

done < "$input_file"


