Checkscript.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
| Zeile 44: | Zeile 44: | ||
# | # | ||
ping -c 1 192.168.1.2 >/dev/null && { echo "pc"; exit; } | ping -c 1 192.168.1.2 >/dev/null && { echo "pc"; exit; } | ||
| + | |||
| + | # eine aufnahme läuft | ||
| + | # | ||
| + | svdrpsend.pl NEXT REL|egrep -q - && { echo "record"; exit; } | ||
</pre> | </pre> | ||
[[Kategorie:Scripts]] | [[Kategorie:Scripts]] | ||
Version vom 14. Dezember 2004, 12:19 Uhr
PC nicht ausschalten, wenn...
#!/bin/sh
# user eingeloggt sind
#
USERCOUNT=`who|wc -l`;
test $5 -eq 0 -a $USERCOUNT -gt 0 && { echo "$USERCOUNT users are logged in."; exit; }
# vdr2divx activ ist
#
pgrep 2divx >/dev/null 2>&1 && { echo divx-conversion is still running; exit; }
# noad activ ist
#
pgrep noad >/dev/null 2>&1 && { echo "noad is still running"; exit; }
# cutinplace activ ist
#
pidof cutinplace >/dev/null 2>&1 && { echo "cutinplace is still running"; exit; }
# file existiert
#
test -a /some/file && { echo /some/file exists; exit; }
# zugriffe per ssh offen sind
#
netstat -n|grep ^tcp|egrep -q ":22 " && { echo "ssh"; exit; }
# Zugriffe auf samba shares offen sind
#
netstat -n|grep ^tcp|egrep -q ":139 " && { echo "smb"; exit; }
# stremdev client activ ist
#
netstat -n|grep ^tcp|egrep -q ":2004 " && { echo "streamdev"; exit; }
# nfs shares offen sind
#
grep -qs ^ /var/lib/nfs/rmtab && { echo "nfs"; exit; }
# pc erreichbar ist
#
ping -c 1 192.168.1.2 >/dev/null && { echo "pc"; exit; }
# eine aufnahme läuft
#
svdrpsend.pl NEXT REL|egrep -q - && { echo "record"; exit; }