Linux and Unix Scripting

Linux – Bash -DDOS Checker, Check if your website is under attack Script.

DDOS Checker, Check if your website is under attack Script.

——————–

#!/bin/bash
clear

if ! [ $1 ];then
echo “Usage: ${0##/} [URL]”
exit 1
fi

url=$(echo $1 | sed ‘s!.*/!!g’) # remove https if included

down=$(curl -s “https://api.downfor.cloud/httpcheck/$url” -H “User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36” -H “Referer: https://downforeveryoneorjustme.com/$url” -H “Origin: https://downforeveryoneorjustme.com” -compressed | sed ‘s/,/\n/g’ | grep “isDown” | awk -F: ‘{print $2}’) # print seconds column

if [[ $down == “false” ]];then
echo “$url is up”;
else
echo “$url is down”
fi