From cdaa731792a9f14bdc7312beac19039c742aa7ce Mon Sep 17 00:00:00 2001 From: Matthias Schwarzott Date: Sun, 6 Jul 2008 15:53:59 +0000 Subject: Run post-start addons also when vdr did not start. This will print syslog output then. Add config-setting to disable syslog parsing. svn path=/gentoo-vdr-scripts/trunk/; revision=630 --- etc/init.d/vdr | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'etc/init.d') diff --git a/etc/init.d/vdr b/etc/init.d/vdr index a63a0a2..b7da10e 100755 --- a/etc/init.d/vdr +++ b/etc/init.d/vdr @@ -39,8 +39,6 @@ depend() { } start_vdr() { - local exitcode - einfo "Preparing start of vdr:" clear_logfile init_params @@ -69,24 +67,19 @@ start_vdr() { debug_msg " CMDLINE: ${_openvt} start-stop-daemon ${daemonctrl_opts} -- ${vdr_opts}" eval ${_openvt} start-stop-daemon ${daemonctrl_opts} -- ${vdr_opts} - exitcode=$? - eend $exitcode "Failed to start vdr." + vdr_exitcode=$? + eend $vdr_exitcode "Failed to start vdr." - # TODO: Anything todo if starting fails? cleanups? - if [ "${exitcode}" = "0" ]; then - load_addons_prefixed post-start - if [ "$?" != "0" ]; then - exitcode=1 - fi + # TODO: Anything todo if starting failed? cleanups? - # wenn nachrichten vorhanden sind - if [ -s "${VDR_LOG_FILE}" ]; then - /usr/share/vdr/bin/vdr-bg.sh svdrpsend.pl mesg "Errors: Go to Commands/View VDR Start Log" - fi + load_addons_prefixed post-start || vdr_exitcode=1 + # show if we have messages + if [ "${vdr_exitcode}" = "0" -a -s "${VDR_LOG_FILE}" ]; then + /usr/share/vdr/bin/vdr-bg.sh svdrpsend.pl mesg "Errors: Go to Commands/View VDR Start Log" fi - return $exitcode + return $vdr_exitcode } stop_vdr() { -- cgit v1.2.3-65-gdbad