From 59076aeeb3561c87bbf0df99760df0ae43dfed8b Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 4 Nov 2012 12:05:26 -0800 Subject: [PATCH] Wrapper script for hpodder --- bin/run-hpodder | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/run-hpodder diff --git a/bin/run-hpodder b/bin/run-hpodder new file mode 100755 index 0000000..3cf70c4 --- /dev/null +++ b/bin/run-hpodder @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +logdir="/tmp/hpodder/" +logfile="$logdir`whoami`.`date +%F`.log" +lockfile="$logdir/lock.log" +dir=`dirname $0` + +if [[ ! -d $logdir ]]; then + echo "Log directory doesn't exist, create it '$lockfile'" + mkdir -p $logdir + chmod 777 $logdir +fi + +if [[ -f $lockfile ]]; then + echo "Exit, stale lock file found $lockfile" + exit 1 +fi + +touch $lockfile +hpodder fetch >> $logfile +$dir/prefix-date ~/podcasts/ >> $logfile +rm $lockfile +