#!/bin/bash
# checks a URL, and converts the response code into 1=ON or 0=OFF.
# --insecure: skip TLS CA verification
# -L: follow redirects
# -b cookies.txt: enable cookie engine and store cookies
# -s: silent mode
# -o /dev/null: supress output 
# -w: write to stdout
[[ $(curl --insecure -b cookies.txt -L -s -o /dev/null -w "%{response_code}\n" $1) == "200" ]] && echo 1 || echo 0

