merge-commands.sh 593 Bytes
Newer Older
1
#
2 3 4 5
# This file is called by /etc/init.d/vdr and the by vdr.service
#
# merges single <cmdtype>.<name>.conf files into one <cmdtype>.conf
# in alphabetical order
6 7
#

8 9
. /usr/lib/vdr/config-loader.sh

10 11
writewarning ()
{
12 13 14 15 16 17
cat > "$2" <<EOF
# This file is automatically generated by the vdr init-script. You can
# define custom commands in /etc/vdr/command-hooks/$1.custom.conf
# (see /usr/share/doc/vdr/README.Debian.gz).

EOF
18 19
}

20 21
cmdtype=$1
cmdfile="/var/cache/vdr/$cmdtype.conf"
22

23
writewarning $cmdtype "$cmdfile"
24

25
find $CMDHOOKSDIR -maxdepth 1 -name "$cmdtype.*.conf" | sort | xargs cat >> "$cmdfile"