Meine vdrshutdown (aus dem 0.4 Plugin):
#!/bin/bash
# $Id: vdrshutdown,v 1.15 2003/08/06 12:55:44 bistr-o-math Exp $
NVRAMCMD=/usr/bin/nvram-wakeup
SVDRPCMD=/usr/bin/svdrpsend.pl
CHECKSCRIPT=/path/to/the/script
#################
## if the script $CHECKSCRIPT thinks that we should shutdown,
## it must not pint anything on stdout.
## if it thinks that we should NOT shutdown,
## it must pint a one-line message on stdout.
##
## note that all parameters passed to vdrshutdown will also be passed to $CHECKSCRIPT
## so it might use them (e.g. $5 -eq 0 below)
##
## it might look like this:
## --------------------------
## #!/bin/bash
##
## pgrep 2divx && { echo Divx-Conversion is still running; exit; }
##
## test -a /some/file && { echo /some/file exists; exit; }
##
## USERCOUNT=`who --count | grep users= | cut -f 2 -d "="`;
## test $5 -eq 0 -a $USERCOUNT -gt 0 && { echo "$USERCOUNT users are logged in."; exit; }
##
## --------------------------
##
## now if $CHECKSCRIPT exists and is executable, the message will be passed through
## SVDRP to the tv screen.
##
test -x $CHECKSCRIPT && {
msg=`$CHECKSCRIPT $*`
test "$msg" != "" && {
$SVDRPCMD MESG $msg &
exit 1
}
}
#################
# Add here needed options like --configfile=...
# (read man nvram-wakeup and man nvram-wakeup.conf for more details)
$NVRAMCMD -s $1 -C /etc/vdr/msi6178.conf
case $PIPESTATUS in
0) # all went ok - new date and time set
# shutdown -h now
poweroff
EXITSTATUS=0
;;
1) # all went ok - new date and time set.
#
# *** but we need to reboot. ***
#
# for some boards this is needed after every change.
#
# for some other boards, we only need this after changing the
# status flag, i.e. from enabled to disabled or the other way.
# For plan A - (Plan A is not supported anymore---see README)
#
# For plan B - (don't forget to install the modified kernel image first)
#
# lilo -R PowerOff
# shutdown -r now
poweroff
EXITSTATUS=0
;;
2) # something went wrong
# don't do anything - just exit with status 1
EXITSTATUS=1
;;
esac
# exit with 0 if everything went ok.
# exit with 1 if something went wrong.
exit $EXITSTATUS