File: merge-commands.sh

package info (click to toggle)
vdr 2.2.0-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,344 kB
  • ctags: 8,834
  • sloc: ansic: 61,405; perl: 853; makefile: 837; sh: 652; python: 86
file content (25 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# 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
#

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

writewarning ()
{
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
}

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

writewarning $cmdtype "$cmdfile"

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