# # Custom VDR Shutdown Hook # ------------------------- # # Here you can place any commands, you want to be executed when VDR wants # to shutdown. # # * To abort the shutdown, exit with an errorlevel <> 0. # # * If you want a message to be displayed on the OSD when aborting a shutdown, # then write to stdout: # # ABORT_MESSAGE= # # * If you want to defer the shutdown, write to stdout: # # TRY_AGAIN= # # * To overwrite the command that will be executed to shutdown the machine # after all shutdown hooks have been processed, write to stdout: # # SHUTDOWNCMD= # # i.e.: # # echo "ABORT_MESSAGE=\"I do not want to shutdown now!\"" ; exit 1 # # Vorgezogener fsck, falls ein fsck innerhalb der nächsten 24h ansteht LOG="logger -t vdr-shutdown" NextFsck=`tune2fs -l /dev/hda1 | grep "Next check after" | cut -d":" -f2-` if [ `date -d "$NextFsck" +%s` -lt $[`date +%s`+86400] ]; then $LOG "Reboot für FSCK"; echo "SHUTDOWNCMD=\"shutdown -F -r now\""; exit 0 else $LOG "kein FSCK notwendig"; exit 0 fi