infra/roles/owntone/templates/owntone-trigger-rescan.sh.j2

18 lines
372 B
Django/Jinja

#!/bin/bash
# {{ ansible_managed }}
set -e
{% for item in ['podcasts', 'audiobooks', 'music'] -%}
if [[ ! -f "{{ audio_dir }}/{{ item }}/.checkfile" ]]; then
echo "{{ audio_dir }}/{{ item }}/.checkfile is gone!"
exit 1
fi
{% endfor %}
rescan_type=$1
trigger_file={{ audio_dir }}/local/trigger.${rescan_type}-rescan
touch $trigger_file
sleep 10
rm $trigger_file