################################################################################# # # # The following configuration file is generated automatically by the yaVDR # # system. Don't change this file as every update of yaVDR will overwrite # # the local changes. Instead put your required customizations # # into /etc/yavdr/templates_custom/ based on the original templates # # under /usr/share/yavdr/templates. # # # # http://www.yavdr.org/developer-zone/template-overview/ # # # # # ################################################################################# start on stopped kodi task script # log the status with which we left kodi logger -t "Kodi" "Kodi exit with exit status $EXIT_STATUS, $EXIT_SIGNAL, ENV: $(env) ." # kill kodi.bin ghost process if pidof kodi.bin &> /dev/null ; then killall -9 kodi.bin ||: fi # in case we want to shutdown do it, else make sure default rate is set in all cases case $EXIT_STATUS in 64|66) echo 0 > /tmp/kodi-active case "$(vdr-dbus-send /Shutdown shutdown.ConfirmShutdown boolean:true | grep -m 1 int32 | egrep -e "[[:digit:]]{3}" -o)" in 990|250) logger -t "kodi-exit.conf" "VDR ready to shutdown, sending POWER signal to VDR" vdr-dbus-send /Remote remote.HitKey string:'Power' || /bin/true ;; *) logger -t "kodi-exit.conf" "can't shutdown, restarting Kodi" signal-event reset-display-rate /sbin/initctl emit --no-wait vdr-frontend-restart ;; esac ;; *) case "$(cat /tmp/kodi-shutdown)" in 1) signal-event reset-display-rate /sbin/initctl emit vdr-frontend-restart sleep 5 vdr-dbus-send /Remote remote.HitKey string:'Power' || /bin/true ;; *) signal-event reset-display-rate /sbin/initctl emit --no-wait vdr-frontend-restart ;; esac ;; esac #clean up rm -f /tmp/kodi-active rm -f /tmp/kodi-shutdown end script