Skip to content

Instantly share code, notes, and snippets.

@ChrisMorrisOrg
Last active May 7, 2016 12:17
Show Gist options
  • Save ChrisMorrisOrg/8bd16d602b6f710a1ea69d7e43d5630a to your computer and use it in GitHub Desktop.
Save ChrisMorrisOrg/8bd16d602b6f710a1ea69d7e43d5630a to your computer and use it in GitHub Desktop.
Download every zine from Phrack
#!/bin/sh
# Download every zine from Phrack
COUNTER=1
while [ $COUNTER -ne -1 ]; do
FILE="phrack$COUNTER.tar.gz"
URL="http://phrack.org/archives/tgz/$FILE"
if [ ! -f $FILE ] && [ ! -d $COUNTER ]; then
exists=`wget -S --spider $URL 2>&1 | grep '200 OK'`
if [[ $exists ]]; then
echo "Downloading Phrack #$COUNTER $URL"
wget -q $URL
mkdir $COUNTER 2>/dev/null && tar xvzf $FILE -C $COUNTER 2>/dev/null
rm $FILE 2>/dev/null
let COUNTER=$COUNTER+1
else
echo "Completely phracked!"
let COUNTER=-1
fi
else
echo "Already Downloaded: $URL"
let COUNTER=$COUNTER+1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment