Installscript-shutdown-cmds
Aus VDR Wiki
(Unterschied zwischen Versionen)
(→Beschreibung) |
|||
| Zeile 6: | Zeile 6: | ||
<NAME>.run | <NAME>.run | ||
| − | Im Beispiel wird der Shutdown um 15min verzögert, falls das [[vdrrip-plugin]] noch am ''wandeln'' ist. | + | Im Beispiel (1) wird der Shutdown um 15min verzögert, falls das [[vdrrip-plugin]] noch am ''wandeln'' ist. |
Das ganze kann im [[admin-plugin]] aktiviert bzw deaktiviert werden. ('''0 = inactiv, 1 = activ) | Das ganze kann im [[admin-plugin]] aktiviert bzw deaktiviert werden. ('''0 = inactiv, 1 = activ) | ||
| Zeile 25: | Zeile 25: | ||
shutdown.sh -- waiting period 15 minutes up to the next shutdown... | shutdown.sh -- waiting period 15 minutes up to the next shutdown... | ||
| − | ==Bsp== | + | ==Bsp (1)== |
{{Box Datei| ../shutdown-cmds/queuehandler.run | | {{Box Datei| ../shutdown-cmds/queuehandler.run | | ||
<pre> | <pre> | ||
| Zeile 40: | Zeile 40: | ||
EXITCODE=1 | EXITCODE=1 | ||
fi | fi | ||
| + | </pre> | ||
| + | }} | ||
| + | |||
| + | ==Bsp (2)== | ||
| + | Hier wird der Shutdown um 15min verschoben, falls '''$CHECKPROCS''' activ sind... | ||
| + | |||
| + | {{Box Datei| ../shutdown-cmds/procs.run | | ||
| + | <pre> | ||
| + | #!/bin/sh | ||
| + | # | ||
| + | # shutdown 'wait' script (../../scripts/shutdown.sh -> $0) | ||
| + | |||
| + | START="1" | ||
| + | ENTRY=$"proc(s) running" | ||
| + | WAITING="15" | ||
| + | CHECKPROCS="tvm2vdr.pl infosatepg cutinplace transcode vcdimager mencoder tosvcd lame noad wget rtorrent" | ||
| + | |||
| + | for i in $CHECKPROCS ; do | ||
| + | if [ -n "$(pidof $i)" -o -n "$(pidof -x $i)" ] ; then | ||
| + | MESSAGE="$i running" | ||
| + | EXITCODE=1 | ||
| + | fi | ||
| + | done | ||
</pre> | </pre> | ||
}}[[Kategorie:Installscript]] | }}[[Kategorie:Installscript]] | ||
Version vom 22. Oktober 2005, 22:55 Uhr
Beschreibung
In ../shutdown-cmds befinden sich Scripte, welche den Shutdown Prozess verzögern.
Format:
<NAME>.run
Im Beispiel (1) wird der Shutdown um 15min verzögert, falls das vdrrip-plugin noch am wandeln ist.
Das ganze kann im admin-plugin aktiviert bzw deaktiviert werden. (0 = inactiv, 1 = activ)
Alles weitere sollte im syslog ersichtlich sein. (vorrausgesetzt $VDR_LOG -gt 0)
'START'='0' -> '../shutdown-cmds/nfs.run' 'START'='0' -> '../shutdown-cmds/procs.run' 'START'='1' -> '../shutdown-cmds/queuehandler.run' 'START'='0' -> '../shutdown-cmds/samba.run' 'START'='0' -> '../shutdown-cmds/ssh.run' 'START'='0' -> '../shutdown-cmds/streamdev.run' 'START'='0' -> '../shutdown-cmds/users.run' ... shutdown.sh -- stop shutdown, because vdrrip running... shutdown.sh -- waiting period 15 minutes up to the next shutdown...
Bsp (1)
#!/bin/sh
#
# shutdown 'wait' script (../../scripts/shutdown.sh -> $0)
START="0" # 0 = inactiv / 1 = activ
ENTRY=$"vdrrip running" # eintrag für das admin plugin
WAITING="15" # wartezeit (shutdown -> 15min -> shutdown)
if [ -s "$VDR_CONFIG/plugins/queue.vdrrip" ] ; then
MESSAGE="vdrrip running" # message im syslog + svdrp
EXITCODE=1
fi
Bsp (2)
Hier wird der Shutdown um 15min verschoben, falls $CHECKPROCS activ sind...
#!/bin/sh
#
# shutdown 'wait' script (../../scripts/shutdown.sh -> $0)
START="1"
ENTRY=$"proc(s) running"
WAITING="15"
CHECKPROCS="tvm2vdr.pl infosatepg cutinplace transcode vcdimager mencoder tosvcd lame noad wget rtorrent"
for i in $CHECKPROCS ; do
if [ -n "$(pidof $i)" -o -n "$(pidof -x $i)" ] ; then
MESSAGE="$i running"
EXITCODE=1
fi
done