Last active
July 30, 2016 21:07
-
-
Save joecannatti/4932403a5c239d9a02501d000505c9f0 to your computer and use it in GitHub Desktop.
Security Now Episode Downloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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