Add second UUID to template
[infodrom/musiikki-web.git] / bin / musiikki-rescan
1 #! /bin/bash
2
3 #
4 # Run via cron every 5 minutes
5 #
6
7 cfg=/etc/musiikki.conf
8
9 if [ ! -f ${cfg} ]
10 then
11     echo "Cannot find config file ${cfg}" > /dev/stderr
12     exit 2
13 fi
14
15 . $cfg
16
17 #
18 # Unfortunately minidlnad is not able to rescan the archive during
19 # regular operation.  Depending on the size of the archive rescanning
20 # can last for one hour or more, and only few files will be announced
21 # during this operation.
22 #
23
24 if [ -f "${rescan_file}" ]
25 then
26     trap "rm -f ${rescan_file}" INT EXIT QUIT
27
28     if [ "${rescan_file}" -nt "${cache}" ]
29     then
30         /usr/sbin/minidlnad -R
31         /usr/sbin/service minidlna restart
32     fi
33 fi