Skip to content

Instantly share code, notes, and snippets.

@james-see
Created December 16, 2019 21:42
Show Gist options
  • Save james-see/e1683f04519821e5fdf6ab9d03cd7c13 to your computer and use it in GitHub Desktop.
Save james-see/e1683f04519821e5fdf6ab9d03cd7c13 to your computer and use it in GitHub Desktop.
how to quickly get head status of each url for onion sites
#!/bin/bash
while read LINE; do
curl -o /dev/null --silent --socks5-hostname 127.0.0.1:9050 --head --write-out "%{http_code} $LINE\n" "$LINE"
done < url-list.txt
@james-see
Copy link
Author

Updated with Redis intergration:

#!/bin/bash
redis-cli flushall
redis-cli set starttime "$(TZ=UTC date -R)"
while read LINE; do
    if [[ $(curl -o /dev/null -s --socks5-hostname 127.0.0.1:9050 --head --connect-timeout 15 --max-time 20 -w '%{http_code}\n' "$LINE") == "200" ]]; then redis-cli sadd up "$LINE"; else redis-cli sadd down "$LINE"; fi
done < url-list.txt

@james-see
Copy link
Author

Updated with Redis intergration:

#!/bin/bash
redis-cli flushall
redis-cli set starttime "$(TZ=UTC date -R)"
while read LINE; do
    if [[ $(curl -o /dev/null -s --socks5-hostname 127.0.0.1:9050 --head --connect-timeout 15 --max-time 20 -w '%{http_code}\n' "$LINE") == "200" ]]; then redis-cli sadd up "$LINE"; else redis-cli sadd down "$LINE"; fi
done < url-list.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment