Commit 24d15322 authored by etobi's avatar etobi

Let systemd service create reccmds.conf/commands.conf when starting vdr

parent 2a7117bb
#
# This file is called by /etc/init.d/vdr
# 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 ()
{
echo -e \
......@@ -12,17 +17,9 @@ echo -e \
"#\n\n\n"
}
# merges single <cmdtype>.<name>.conf files into one <cmdtype>.conf
# in alphabetical order
mergecommands ()
{
local cmdtype
local cmdfile
cmdtype=$1
cmdfile="/var/cache/vdr/$cmdtype.conf"
cmdtype=$1
cmdfile="/var/cache/vdr/$cmdtype.conf"
writewarning $cmdtype > "$cmdfile"
writewarning $cmdtype > "$cmdfile"
find $CMDHOOKSDIR -maxdepth 1 -name "$cmdtype.*.conf" | sort | xargs cat >> "$cmdfile"
}
find $CMDHOOKSDIR -maxdepth 1 -name "$cmdtype.*.conf" | sort | xargs cat >> "$cmdfile"
......@@ -27,9 +27,6 @@ test -x $VDRPRG || exit 0
. /usr/lib/vdr/config-loader.sh
. /usr/lib/vdr/commands-loader.sh
clean_console()
{
if [ "$KEYB_TTY" != "" ]; then
......@@ -69,8 +66,8 @@ startvdr()
if start-stop-daemon --start --startas $DAEMON --test \
--name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
then
mergecommands "commands"
mergecommands "reccmds"
/bin/sh /usr/lib/vdr/merge-commands.sh "commands"
/bin/sh /usr/lib/vdr/merge-commands.sh "reccmds"
configure_console_input
start-stop-daemon --start --quiet --startas $DAEMON --background -d /tmp \
......
......@@ -13,7 +13,7 @@ epg2html usr/lib/vdr/
debian/runvdr usr/lib/vdr/
debian/config-loader.sh usr/lib/vdr/
debian/commands-loader.sh usr/lib/vdr/
debian/merge-commands.sh usr/lib/vdr/
debian/vdr-groups.sh usr/lib/vdr/
debian/vdr-recordingaction usr/lib/vdr/
debian/vdr-shutdown usr/lib/vdr/
......
......@@ -3,6 +3,8 @@ Description=Video Disk Recorder
[Service]
Type=notify
ExecStartPre=/bin/sh /usr/lib/vdr/merge-commands.sh "commands"
ExecStartPre=/bin/sh /usr/lib/vdr/merge-commands.sh "recmds"
ExecStart=/usr/bin/vdr
Restart=on-failure
RestartPreventExitStatus=0 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment