Last active
June 23, 2018 13:59
-
-
Save mzfshark/de1d0995bea9b54f9b9a8447e49f4ef9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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