Skip to content

Instantly share code, notes, and snippets.

@mzfshark
Last active June 23, 2018 13:59
Show Gist options
  • Save mzfshark/de1d0995bea9b54f9b9a8447e49f4ef9 to your computer and use it in GitHub Desktop.
Save mzfshark/de1d0995bea9b54f9b9a8447e49f4ef9 to your computer and use it in GitHub Desktop.
#!/bin/sh
arquivo=./listafinal.txt
####################################
total=$(wc -l < $arquivo)
atual=0
clear
while read url
do
#url=${url%?}
url=${url%$'\r'}
atual=$(($atual+1))
acao="OK"
httpcode=$(curl -s --head $url | head -n 1)
if echo $httpcode | grep -q "HTTP/2 404"; then
acao="ERRO"
fi
echo "[$(date +%H:%M)] $(( $atual*100/$total ))% [$acao] $url"
echo $url >> url-$acao.txt
done < $arquivo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment