Results 1 to 6 of 6
Hi,
I use JDownloader to get huge files from the internet when I'm afk.
The problem is when I'm too afk the computer is still ON even if the downloads ...
- 09-24-2011 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 3
Halt computer when a program stops running
Hi,
I use JDownloader to get huge files from the internet when I'm afk.
The problem is when I'm too afk the computer is still ON even if the downloads are finished.
Now JDownloader has a functionality that exits the program when all downloads are finished; so I need your help guys to find a way to shutdown the computer once JDownloader is not running anymore.
Thanks...
- 09-27-2011 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,977
Write a script that monitors JDownloader and switches the system to runlevel 0 (halt) when it terminates.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 09-28-2011 #3Just Joined!
- Join Date
- Sep 2011
- Posts
- 3
That might be the way. Any idea how to do it?
- 09-28-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,855
assuming the prog is called JDownloader...
Code:#!/bin/bash pid=$(pidof -x JDownloader) if [ -n "$pid" ]; then echo "JDownloader (pid $pid) still running..." else echo JDownloader is not running echo halting #shutdown -h now fi
- 09-28-2011 #5Just Joined!
- Join Date
- Sep 2011
- Posts
- 3
- 09-29-2011 #6Linux Guru
- Join Date
- May 2011
- Posts
- 1,855
yeah, cron it or wrap it inside:
Code:while :; do ... sleep 1 done


Reply With Quote
