Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- URL=$1
- GREEN='\033[00;32m'
- RED='\033[0;31m'
- NC='\033[0m'
- while true
- do
- ret=$(curl -I -s "$URL" -o /dev/null -w "%{http_code}|%{remote_ip}\n");
- printf "[`date +%T,%3N`] $URL = ";
- if [ ${ret%\|*} -ne 200 ]; then
- printf "${RED}";
- else
- printf "${GREEN}";
- fi
- printf "${ret%\|*}${NC} ${ret/*\|}\n";
- sleep 1;
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement