You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
515 B
Bash
27 lines
515 B
Bash
#!/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 '$logdir'"
|
|
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
|
|
cd ~/podcasts
|
|
for dir in $(find . -maxdepth 1 -mindepth 1 -type d); do
|
|
prefix-date $dir
|
|
done
|
|
cd -
|
|
rm $lockfile
|