Hi,

--- On Wed, May 12, 2010 at 1:02 PM, Girish Venkatachalam
<[email protected]> wrote:
| I have been wanting to automatically switch off my machine after the
| music stops playing.
|
| This simple shell script does a great job when run as root.
|
| #!/bin/sh
|
| while [ "1" = "1" ]; then
| do
|           sleep 15
|           echo "Checking for mplayer..."
|           stat=`pgrep mplayer`
|           if [ "$stat" = "" ]; then
|                        shutdown -hP now
|           fi
| done
\--

Try the following in the <command> section of an /etc/crontab entry?

  pgrep mplayer || shutdown -hP now

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to