Installscript-shutdown-cmds
Aus VDR Wiki
(Unterschied zwischen Versionen)
Hulk (Diskussion | Beiträge) K (Schützte „Installscript-shutdown-cmds“: Weblink-Spam ([edit=autoconfirmed] (unbeschränkt) [move=autoconfirmed] (unbeschränkt))) |
|||
| (24 dazwischenliegende Versionen von 13 Benutzern werden nicht angezeigt) | |||
| Zeile 2: | Zeile 2: | ||
In '''../shutdown-cmds''' befinden sich Scripte, welche den Shutdown Prozess verzögern. | In '''../shutdown-cmds''' befinden sich Scripte, welche den Shutdown Prozess verzögern. | ||
| − | Format: | + | Format (Datei): |
| − | <NAME>. | + | '''<NAME>'''.cmd |
| − | + | Format (Head): | |
| + | |||
| + | START="1" # 0 = inactiv / 1 = activ | ||
| + | ENTRY=$"Beschreibung" # eintrag für das [[admin-plugin]] <description> | ||
| + | WAITING="15" # wartezeit (shutdown -> 15min -> shutdown) | ||
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) | ||
| − | [[Bild:admin- | + | ''Oder, auf der Kommandozeile.'' |
| + | |||
| + | shell> [[Installscript-dialog.sh|$PREFIX/etc/vdr/admin/dialog.sh]] | ||
| + | |||
| + | [[Bild:installscript-admin-shutdown-cmds.jpg|thumb|none|''kurze beschreibung'']] | ||
Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''') | Alles weitere sollte im '''syslog''' ersichtlich sein. (vorrausgesetzt '''$VDR_LOG -gt 0''') | ||
| − | 'START'=' | + | 'START'='1' -> '../shutdown-cmds/procs.cmd' |
| − | + | 'START'='1' -> '../shutdown-cmds/queuehandler.cmd' | |
| − | 'START'='1' -> '../shutdown-cmds/queuehandler. | + | 'START'='0' -> '../shutdown-cmds/samba.cmd' |
| − | 'START'='0' -> '../shutdown-cmds/samba. | + | 'START'='0' -> '../shutdown-cmds/ssh.cmd' |
| − | 'START'='0' -> '../shutdown-cmds/ssh. | + | 'START'='0' -> '../shutdown-cmds/streamdev.cmd' |
| − | 'START'='0' -> '../shutdown-cmds/streamdev. | + | 'START'='0' -> '../shutdown-cmds/users.cmd' |
| − | 'START'='0' -> '../shutdown-cmds/users. | + | |
... | ... | ||
shutdown.sh -- stop shutdown, because vdrrip running... | shutdown.sh -- stop shutdown, because vdrrip running... | ||
| Zeile 26: | Zeile 33: | ||
==Bsp (1)== | ==Bsp (1)== | ||
| − | {{Box Datei| ../shutdown-cmds/queuehandler. | + | Hier wird der Shutdown um 15min verschoben, falls das [[vdrrip-plugin]] noch am ''wandeln'' ist. |
| + | |||
| + | {{Box Datei| ../shutdown-cmds/queuehandler.cmd | | ||
<pre> | <pre> | ||
#!/bin/sh | #!/bin/sh | ||
# | # | ||
| − | # shutdown | + | # example shutdown wait script |
| − | START=" | + | START="1" |
| − | ENTRY=$"vdrrip running" | + | ENTRY=$"vdrrip running" |
| − | WAITING="15" | + | WAITING="15" |
| − | if [ -s "$VDR_CONFIG/plugins/queue.vdrrip" ] ; then | + | if [ -s "$VDR_CONFIG/plugins/vdrrip/queue.vdrrip" ] ; then |
| − | MESSAGE="vdrrip running" | + | MESSAGE=$"stop shutdown, vdrrip running" |
EXITCODE=1 | EXITCODE=1 | ||
fi | fi | ||
| Zeile 44: | Zeile 53: | ||
==Bsp (2)== | ==Bsp (2)== | ||
| − | Hier wird der Shutdown um 15min verschoben, falls '''$CHECKPROCS''' activ sind | + | Hier wird der Shutdown um 15min verschoben, falls '''$CHECKPROCS''' activ sind. |
| − | {{Box Datei| ../shutdown-cmds/procs. | + | {{Box Datei| ../shutdown-cmds/procs.cmd | |
<pre> | <pre> | ||
#!/bin/sh | #!/bin/sh | ||
# | # | ||
| − | # shutdown | + | # example shutdown wait script |
START="1" | START="1" | ||
| Zeile 59: | Zeile 68: | ||
for i in $CHECKPROCS ; do | for i in $CHECKPROCS ; do | ||
if [ -n "$(pidof $i)" -o -n "$(pidof -x $i)" ] ; then | if [ -n "$(pidof $i)" -o -n "$(pidof -x $i)" ] ; then | ||
| − | MESSAGE="$i running" | + | MESSAGE=$"stop shutdown, $i running" |
EXITCODE=1 | EXITCODE=1 | ||
| + | break | ||
fi | fi | ||
done | done | ||
</pre> | </pre> | ||
| − | }}[[Kategorie:Installscript]] | + | }} |
| + | |||
| + | ==Bsp (3)== | ||
| + | Hier wird der Shutdown um 15min verschoben, falls Verbindungen / Ports offen sind ([[streamdev-plugin]]). | ||
| + | |||
| + | {{Box Datei| ../shutdown-cmds/streamdev.cmd | | ||
| + | <pre> | ||
| + | #!/bin/sh | ||
| + | # | ||
| + | # example shutdown wait script | ||
| + | |||
| + | START="0" | ||
| + | ENTRY=$"streamdev client(s) connected" | ||
| + | WAITING="15" | ||
| + | |||
| + | port1=($(grep -s ^streamdev-server.ServerPort "${VDR_CONFIG}/setup.conf")) | ||
| + | port2=($(grep -s ^streamdev-server.HTTPServerPort "${VDR_CONFIG}/setup.conf")) | ||
| + | |||
| + | for i in ${port1[2]:-2004} ${port2[2]:-3000} ; do | ||
| + | count=$(netstat -n | egrep -c ^tcp.*:$i[[:space:]]) | ||
| + | if [ $count -ne 0 ] ; then | ||
| + | MESSAGE=$"stop shutdown, $count streamdev client(s) connected" | ||
| + | EXITCODE=1 | ||
| + | break | ||
| + | fi | ||
| + | done | ||
| + | </pre> | ||
| + | }} | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | [[Kategorie:Installscript]] | ||
Aktuelle Version vom 14. Oktober 2009, 05:40 Uhr
Inhaltsverzeichnis |
[Bearbeiten] Beschreibung
In ../shutdown-cmds befinden sich Scripte, welche den Shutdown Prozess verzögern.
Format (Datei):
<NAME>.cmd
Format (Head):
START="1" # 0 = inactiv / 1 = activ ENTRY=$"Beschreibung" # eintrag für das admin-plugin <description> WAITING="15" # wartezeit (shutdown -> 15min -> shutdown)
Das ganze kann im admin-plugin aktiviert bzw deaktiviert werden. (0 = inactiv, 1 = activ)
Oder, auf der Kommandozeile.
shell> $PREFIX/etc/vdr/admin/dialog.sh
Alles weitere sollte im syslog ersichtlich sein. (vorrausgesetzt $VDR_LOG -gt 0)
'START'='1' -> '../shutdown-cmds/procs.cmd' 'START'='1' -> '../shutdown-cmds/queuehandler.cmd' 'START'='0' -> '../shutdown-cmds/samba.cmd' 'START'='0' -> '../shutdown-cmds/ssh.cmd' 'START'='0' -> '../shutdown-cmds/streamdev.cmd' 'START'='0' -> '../shutdown-cmds/users.cmd' ... shutdown.sh -- stop shutdown, because vdrrip running... shutdown.sh -- waiting period 15 minutes up to the next shutdown...
[Bearbeiten] Bsp (1)
Hier wird der Shutdown um 15min verschoben, falls das vdrrip-plugin noch am wandeln ist.
#!/bin/sh
#
# example shutdown wait script
START="1"
ENTRY=$"vdrrip running"
WAITING="15"
if [ -s "$VDR_CONFIG/plugins/vdrrip/queue.vdrrip" ] ; then
MESSAGE=$"stop shutdown, vdrrip running"
EXITCODE=1
fi
[Bearbeiten] Bsp (2)
Hier wird der Shutdown um 15min verschoben, falls $CHECKPROCS activ sind.
#!/bin/sh
#
# example shutdown wait script
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=$"stop shutdown, $i running"
EXITCODE=1
break
fi
done
[Bearbeiten] Bsp (3)
Hier wird der Shutdown um 15min verschoben, falls Verbindungen / Ports offen sind (streamdev-plugin).
#!/bin/sh
#
# example shutdown wait script
START="0"
ENTRY=$"streamdev client(s) connected"
WAITING="15"
port1=($(grep -s ^streamdev-server.ServerPort "${VDR_CONFIG}/setup.conf"))
port2=($(grep -s ^streamdev-server.HTTPServerPort "${VDR_CONFIG}/setup.conf"))
for i in ${port1[2]:-2004} ${port2[2]:-3000} ; do
count=$(netstat -n | egrep -c ^tcp.*:$i[[:space:]])
if [ $count -ne 0 ] ; then
MESSAGE=$"stop shutdown, $count streamdev client(s) connected"
EXITCODE=1
break
fi
done