proxytools

- collection of scripts for harvesting & testing proxies
git clone git://git.acid.vegas/proxytools.git
Log | Files | Refs | Archive | README | LICENSE

remove.sh (898B)

      1 #!/bin/bash
      2 cd "$(dirname "$0")"
      3 KEY="$(<dronebl.key)"
      4 
      5 (
      6         echo "<?xml version=\"1.0\"?><request key=\"$KEY\">"
      7         while [ -n "$1" ] ; do
      8                 echo "<lookup ip=\"$1\" />"
      9                 shift
     10         done
     11         echo "</request>"
     12 ) \
     13 |       curl -s --data @- https://dronebl.org/RPC2  \
     14 |       (xmllint --xpath '/response/result/@id' - 2>/dev/null | sed -n -e 's, id="\([^"]*\)",\1\n,gp') \
     15 |(
     16         echo "<?xml version=\"1.0\"?><request key=\"$KEY\">"
     17         while read ID ; do
     18                 echo "Remove ID $ID" >&2
     19                 echo "<remove id=\"$ID\" />"
     20         done
     21         echo "</request>"
     22 ) \
     23 |       tee -a dronebl-remove.log \
     24 |       curl -s --data @- https://dronebl.org/RPC2 | tee -a dronebl-remove.log | grep -q "\"success\""
     25 if [ $? -eq 0 ] ; then
     26         echo "DRONEBL: successfully removed $@"
     27 else
     28         echo "DRONEBL: error removing $@"
     29 fi