#!/bin/bash # By Linc 10/1/2004 -- Modded by behavadave (to act as mirror) (behavedave at orange dot net) # Last revision 12/14/2004 - Many Contributers! # If you use this and have made improvements or have comments # drop me an email at linc dot fessenden at gmail dot com # I'd appreciate it! #Enter your mirror's URL below: myurl=http://www.davidandrewtaylor.co.uk/lugradio_Mirror/ # Make script crontab friendly: cd $(dirname $0) # Delete any temp file: rm -f temp.log # Read the bp.conf file and wget any url not already in the podcast.log file: while read podcast do file=$(wget -q $podcast -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p') for url in $file do echo $url >> temp.log if ! grep "$url" podcast.log > /dev/null then echo downloading $url wget -q "$url" echo registering with http://www.lugradio.org/addmirror/$myurl$(basename $url) GET http://www.lugradio.org/addmirror/$myurl$(basename $url) fi done done < bp.conf # Move dynamically created log file to permanent log file: cat podcast.log >> temp.log sort temp.log | uniq > podcast.log rm temp.log