Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] shutdown-script



good evening,

in the case, somebody is interessted in this topic, i want to share a
little script, that handles the shutdown of my desktop. it takes care of
processes, that needs much cpu time over night -- for example emerge new
software or transcoding movies.

vdr starts daemonized with the option:

-s "touch /tmp/.shutdown" 

the script itself is started every 15 minutes with cron: into your
crontab simply put the line:  

*/15 * * * *    /usr/local/bin/shutdown.sh

that calls the file /usr/local/bin/shutdown.sh, which looks like:

#!/bin/bash
STOP=0
CMD_LST="transcode avisplit avimerge cdrecord python2.2 xawtv"
if `test -f /tmp/.shutdown`
then
    for CMD in ${CMD_LST}
    do  
	if pidof ${CMD} >/dev/null
	then
	    echo "stop shutdown, because" ${CMD} "is running"
	    STOP=1
	fi
    done    
    
    if `test $[${STOP}] -eq 0`
    then
						echo "no important programs are running, shutdown now"
						/sbin/shutdown -h now
    fi
fi

finally i myself am interessted in any improvements and better ideas.
have a nice evening,

Andreas
-- 
____________________________________________________________________

Andreas Reichel                            +49 0174-3262-499  :Phone
Hasenweg 2c                         andreas.reichel@i-kit.de  :Email
D-04463 Grosspoesna, Germany                    www.i-kit.de  :HTTP

Key fingerprint = 3B50 2AAD 9465 1014 5047  F8A9 3955 4DCB D34E C2AF
____________________________________________________________________



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index