Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37558213
en ru br
ALT Linux repos
S:2.2.0-alt12
D:1.6.0-alt1
3.0: 1.3.15-alt1

Group :: Video
RPM: vdr

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/bash

# To enable this script, pass it to vdr with the -s option, eg.
# "-s vdr-shutdown.sh" (sans quotes) in VDR_OPTIONS in /etc/sysconfig/vdr.
# See also below for additional required sudo configuration, and
# README.package for information how to get the time written to ACPI and
# thus getting the system to wake up at the correct time.

# How many minutes before the next timer event should the system wake up,
# ie. how long does it take to boot until VDR is running and ready to record?
# Some CI/CAM's take a long time to initialize so we use a pretty generous
# value here by default.

mins=${WAKEUP_BEFORE_RECORDING:-10}

wakeupfile=/var/lib/vdr/next-wakeup
rm -f $wakeupfile

if [ ${1:-0} -gt 0 ] ; then
echo $(( $1 - $mins * 60 )) > $wakeupfile
fi

# In order to make this work, the vdr user needs to be allowed to run
# "/sbin/shutdown -h now" with sudo as root, without entering a password and
# without a tty. Example sudoers(5) configuration to accomplish that:
# Defaults:vdr !requiretty
# vdr ALL = (root) NOPASSWD: /sbin/shutdown -h now

exec sudo /sbin/shutdown -h now
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin