diff --git a/workflow/hpr-check-feeds.bash b/workflow/hpr-check-feeds.bash index 8ad6a65..bb9d2c0 100755 --- a/workflow/hpr-check-feeds.bash +++ b/workflow/hpr-check-feeds.bash @@ -2,10 +2,11 @@ # cc-0 -tmpfile=$(mktemp /tmp/"$( basename ${0} ).XXXXXX" ) +tmpdir=$(mktemp --directory /tmp/"$( basename ${0} ).XXXXXX" ) base="https://hackerpublicradio.org" for feed in comments.rss comments_rss.php hpr_mp3.rss hpr_mp3_rss.php hpr_mp3_rss.php?series=47 hpr_ogg.rss hpr_ogg_rss.php hpr_ogg_rss.php?series=47 hpr_opus_rss.php hpr_opus_rss.php?series=47 hpr_rss_mp3.php hpr_rss.php hpr_spx.rss hpr.sql.rss hpr_total_mp3.rss hpr_total_ogg.rss hpr_total_ogg_rss.php hpr_total_opus_rss.php hpr_total_rss.php hpr_total_spx.rss rss-ccdnv1.php rss-future.php rss.php do + tmpfile="${tmpdir}/${feed}" wget --no-verbose "${base}/${feed}" --output-document="${tmpfile}" if [[ ! -s "${tmpfile}" || -z "${tmpfile}" ]] then @@ -22,5 +23,13 @@ do else echo "🗸 The feed \"${base}/${feed}\" is valid xml." fi - rm "${tmpfile}" done + +read -p "Remove the feeds ? (Y|n) ? " -n 1 -r +echo # (optional) move to a new line +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + echo "The files are available in \"${tmpdir}\"." +else + rm -v "${tmpdir}/*.*" +fi