Dear visitor, welcome to VDR Portal. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Sowas kann ich eigentlich hier nicht finden --> Vielleicht kann jemnad mal das "davor" einbinden näher erklären?
Quoted
Eigentlich gehört das angehängte davor. Das ruft der Reihe nach alle Scripte in ~/vdr/shutdown-hooks auf. Es lohnt das zu installieren. In diesem Verzeichnis liegen dann alle Shuddownscripte (Ein Minus am Anfang des Dateinamens kommentiert sie aus).
Auf diese Weise kann man schnell weitere Shutdownscripte zusätzlich installieren.
Ist nicht aktiviert.
Quoted
Evtl. verhindet noad das Runterfahren?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
#!/bin/bash
#
# Reel Multimedia AG 2005
#
if [ -d /etc/default ] ; then
. /etc/default/sysconfig
else
. /etc/sysconfig
fi
REELFPCTL=/sbin/reelfpctl
COUNTFILE=/tmp/vdr.records
if [ -e $COUNTFILE ]; then
count=`cat $COUNTFILE`
else
echo 0 > $COUNTFILE
count=0
fi
case "$1" in
before)
echo "Before recording $2"
let count++
# TODO: only on AVG
if [ "$AUTO_NOAD" = "yes" ] ; then
/usr/sbin/noadcall.sh $* >/dev/null 2>&1 &
fi
;;
after)
echo "After recording $2"
let count--
#chmod to world-readable so ftp users can do what they want
chgrp ftpusers -R `echo "$2" | cut -f1-5 -d"/"` &
chmod g+w -R `echo "$2" | cut -f1-5 -d"/"` &
# TODO: only on Lite
# if [ "$AUTO_NOAD" = "yes" ]; then
# /usr/sbin/noadcall.sh $*
# fi
#generate preview
generate_preview.sh "$2"
;;
edited)
echo "Edited recording $2"
chgrp ftpusers -R `echo "$2" | cut -f1-5 -d"/"` &
chmod g+w -R `echo "$2" | cut -f1-5 -d"/"` &
;;
move)
# nothing to do
;;
*)
echo "ERROR: unknown state: $1"
;;
esac
echo $count > $COUNTFILE
if [ $count -eq 0 ]; then
$REELFPCTL -clearled 4
else
$REELFPCTL -setled 4
fi
|
Quoted
Damit der vdruser das vdrpoweroff Skript ausführen kann benötigt dieser root Rechte.
|
|
Source code |
1 2 |
sudo visudo vdruser ALL=(ALL) ... |
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
#!/bin/bash sudo hwclock --systohc --utc NextTimer=$(($1 - 600 )) # 10 minutes earlier sudo bash -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" sudo bash -c "echo $NextTimer > /sys/class/rtc/rtc0/wakealarm" sudo /sbin/poweroff |
This post has been edited 1 times, last edit by "cinfo" (Jun 13th 2011, 5:44pm)
EDIT:
leider gibt es sowas wie "Shutdown hooks" hier im ReelVDR nicht.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
#!/bin/sh
#
# VDR Shutdown Script - Tobias Grimm <tg@e-tobi.net>
# -------------------
#
# see README.Debian
#
SHUTDOWN_HOOKS_DIR=/usr/bin
log="logger -t vdr-shutdown"
svdrpsend="/usr/bin/svdrpsend.pl"
SHUTDOWNCMD="poweroff"
osdmsg()
{
# OSD message must be deferred, to let VDR display it AFTER the
# shutdown script has been executed
sleep 2
$svdrpsend MESG "$1"
}
shutdownhooks=`find $SHUTDOWN_HOOKS_DIR -maxdepth 1 -xtype f -name S??.* | sort`
for shutdownhook in $shutdownhooks; do
TRY_AGAIN=0
if [ -x $shutdownhook ]; then
$log "executing $shutdownhook"
result_data=`$shutdownhook "$@"`
else
$log "executing $shutdownhook as shell script"
result_data=`/bin/sh $shutdownhook "$@"`
fi
result=$?
eval $result_data
if [ $result -ne 0 ] ; then
$log "Shutdown aborted by $shutdownhook with exitcode $result"
osdmsg "Shutdown abgebrochen / Shutdown aborted!" &
[ -z "$ABORT_MESSAGE" ] || osdmsg "$ABORT_MESSAGE" &
[ -z "$LOG_MESSAGE" ] || $log "$LOG_MESSAGE" &
exit $result
fi
if [ $TRY_AGAIN -gt 0 ]
then
$log "$shutdownhook requests to try again in $TRY_AGAIN minutes"
nohup sh -c "( sleep $(( $TRY_AGAIN * 60 )) && $svdrpsend \"HITK Power\" )" >/dev/null 2>&1 &
osdmsg "Shutdown aborted. Retry in $TRY_AGAIN minutes." &
exit 0
fi
done
eval $SHUTDOWNCMD &
|
Quoted
SHUTDOWN_HOOKS_DIR=/usr/bin
|
|
Source code |
1 2 3 4 5 |
# Shutdown System
if [ "$6" = "deepstandby" ]; then
Syslog "shutdown system"
touch /tmp/vdr.deepstandby
fi
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# Shutdown System
if [ "$6" = "deepstandby" ]; then
SHUTDOWN_HOOKS_DIR=/usr/sbin
log="logger -t vdr-shutdown"
svdrpsend="/usr/sbin/svdrpsend.sh"
SHUTDOWNCMD="poweroff"
osdmsg()
{
# OSD message must be deferred, to let VDR display it AFTER the
# shutdown script has been executed
sleep 2
$svdrpsend MESG "$1"
}
shutdownhooks=`find $SHUTDOWN_HOOKS_DIR -maxdepth 1 -xtype f -name S??.* | sort`
for shutdownhook in $shutdownhooks; do
TRY_AGAIN=0
if [ -x $shutdownhook ]; then
$log "executing $shutdownhook"
result_data=`$shutdownhook "$@"`
else
$log "executing $shutdownhook as shell script"
result_data=`/bin/sh $shutdownhook "$@"`
fi
result=$?
eval $result_data
if [ $result -ne 0 ] ; then
$log "Shutdown aborted by $shutdownhook with exitcode $result"
osdmsg "Shutdown abgebrochen / Shutdown aborted!" &
[ -z "$ABORT_MESSAGE" ] || osdmsg "$ABORT_MESSAGE" &
[ -z "$LOG_MESSAGE" ] || $log "$LOG_MESSAGE" &
exit $result
fi
if [ $TRY_AGAIN -gt 0 ]
then
$log "$shutdownhook requests to try again in $TRY_AGAIN minutes"
nohup sh -c "( sleep $(( $TRY_AGAIN * 60 )) && $svdrpsend \"HITK Power\" )" >/dev/null 2>&1 &
osdmsg "Shutdown aborted. Retry in $TRY_AGAIN minutes." &
exit 0
fi
done
eval $SHUTDOWNCMD &
fi
|
This post has been edited 1 times, last edit by "cinfo" (Jun 13th 2011, 9:11pm)
OK, dann wäre SHUTDOWN_HOOKS_DIR = "/usr/sbin/
Das Shutdownhook Script führt nacheinander ALLE Programme in diesem Verzeichis aus. Da wäre /usr/bin nicht so geeignet
Nimm doch sowas wie /etc/vdr/shuttdown-hooks
![]()
Source code
1 2 3 4 5# Shutdown System if [ "$6" = "deepstandby" ]; then Syslog "shutdown system" touch /tmp/vdr.deepstandby fi
Ok,
Quoted
neinDas Shutdownhook Script führt nacheinander ALLE Programme in diesem Verzeichis aus. Da wäre /usr/bin nicht so geeignet
Nimm doch sowas wie /etc/vdr/shuttdown-hooks
ABER wo / woraus starte ich denn jetzt das Shutdownhook-Script von Dir?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
else
LOG="ACPIWakeup functionality is disabled"
echo "LOG_MESSAGE=\"$LOG\""
fi
###########################################################################
### ACPI - ENDE ###
# Shutdown System
SHUTDOWN_HOOKS_DIR=/etc/vdr/shuttdown-hooks
log="logger -t vdr-shutdown"
svdrpsend="/usr/sbin/svdrpsend.sh"
SHUTDOWNCMD="poweroff"
osdmsg()
{
# OSD message must be deferred, to let VDR display it AFTER the
# shutdown script has been executed
sleep 2
$svdrpsend MESG "$1"
}
shutdownhooks=`find $SHUTDOWN_HOOKS_DIR -maxdepth 1 -xtype f -name S??.* | sort`
for shutdownhook in $shutdownhooks; do
TRY_AGAIN=0
if [ -x $shutdownhook ]; then
$log "executing $shutdownhook"
result_data=`$shutdownhook "$@"`
else
$log "executing $shutdownhook as shell script"
result_data=`/bin/sh $shutdownhook "$@"`
fi
result=$?
eval $result_data
if [ $result -ne 0 ] ; then
$log "Shutdown aborted by $shutdownhook with exitcode $result"
osdmsg "Shutdown abgebrochen / Shutdown aborted!" &
[ -z "$ABORT_MESSAGE" ] || osdmsg "$ABORT_MESSAGE" &
[ -z "$LOG_MESSAGE" ] || $log "$LOG_MESSAGE" &
exit $result
fi
if [ $TRY_AGAIN -gt 0 ]
then
$log "$shutdownhook requests to try again in $TRY_AGAIN minutes"
nohup sh -c "( sleep $(( $TRY_AGAIN * 60 )) && $svdrpsend \"HITK Power\" )" >/dev/null 2>&1 &
osdmsg "Shutdown aborted. Retry in $TRY_AGAIN minutes." &
exit 0
fi
done
eval $SHUTDOWNCMD &
|
also sollte ich Dein Shutdownscript in das von Reel umbenennen. OK, da steht aber auch das ACPI Script drin.
Sollte ich das Shutdownscript dann nach dem ACPI Teil ein setzen?
Quoted
/etc/vdr/shuttdown-hooks/10_reel-start
/etc/vdr/shuttdown-hooks/20_ACPI
/etc/vdr/shuttdown-hooks/30_vdr-shutdown
This post has been edited 1 times, last edit by "cinfo" (Jun 13th 2011, 10:14pm)
Quoted
Ich will dir jetzt auch nix überkompleziertes aufdrängen, war nur nen Vorschlag
Quoted
Du kannst auch nur das ACPI Script einbinden.