Guest User

crc check

a guest
Sep 25th, 2013
443
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. for exe in lynx wget grep awk ; do
  3.     if ! [ -x "$(which ${exe})" ] ; then
  4.         echo "Please install '${exe}'!"
  5.         exit 1
  6.     fi
  7. done
  8. CRCSUM="$1"
  9. if [ "$CRCSUM" = "" ] ; then
  10.     echo "No CRC checksum specified!"
  11.     echo "Usage: $0 <crc>"
  12.     exit 1
  13. fi
  14. OUTPUT="$(wget -O- -q http://www.srrdb.com/api/search/archive-crc:${CRCSUM} | sed 's/,/\n/g' | grep -E "release|resultsCount" | awk -F ":" '{print $NF}' | xargs echo | sed 's/ /;/')"
  15. if [ "$OUTPUT" = "0" ] ; then
  16.     echo "1;$CRCSUM;;"
  17.     exit 0
  18. else
  19.     RELEASE="$(awk -F ";" '{print $1}' <<< "$OUTPUT")"
  20. fi
  21. FILENAME="$(lynx -dump -nolist http://www.srrdb.com/release/details/${RELEASE} | grep -A 1 "Archived files" | tail -1 | awk '{print $1}')"
  22. echo "0;${CRCSUM};${FILENAME};${RELEASE}"
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×