Skip to content

Instantly share code, notes, and snippets.

@joecannatti
Last active July 30, 2016 21:07
Show Gist options
  • Save joecannatti/4932403a5c239d9a02501d000505c9f0 to your computer and use it in GitHub Desktop.
Save joecannatti/4932403a5c239d9a02501d000505c9f0 to your computer and use it in GitHub Desktop.
Security Now Episode Downloader
#!/usr/bin/env sh
set -e
CURRENT_SN=570
for i in $(seq -f "%03g" 1 $CURRENT_SN); do
echo "episode $i"
curl -s -O -L https://www.grc.com/sn/sn-$i.txt &
curl -s -O -L https://media.grc.com/sn/sn-$i.mp3 &
trimmed=$( echo $i | sed 's/^0*//' )
mod=$(( $trimmed % 10 ))
if [ $mod -eq 0 ]; then
echo 'waiting'
wait
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment