]> Agilo's Weblog
I stopped painting in 1990 at the peak of my success just to deny people my beautiful paintings. And I did it out of spite.Vincent Gallo
(Add a new entry)  


Sunday, May 16 2004, 04:21PM

Far Cry!

I was downloading 3 GiB (Far Cry) through "wget", a downloading tool for Linux, and I shut down Apache Web Server, because I needed the downstream to be as fast as it can, without being lagged.
So I wrote a script to check if wget was active, and, if not (thus wget was finished / the downloads were finished), start Apache.

The script I wrote:


#!/bin/sh

if [ "`ps aux | grep "wget" | grep "grep" -v`" ]; then
blarbla="yes";
fi;
if [ $blarbla ]; then
echo `date "+%H:%M:%S"`"  Nope, still downloading..";
else
sudo /usr/local/apache2/bin/apachectl start
fi;

And I simply did:
$ sleep 5000 ; ./start.sh ; sleep 5000 ; ./start.sh ; sleep 5000 ; ./start.sh ; sleep 5000 ; ./start.sh ; sleep 5000 ; ./start.sh ; (etc)

And it worked, too!
(I wasn't really sure if it'd work, but I decided to give it a try anyway.)
When I got back, there were 4 messages that the downloads were still active, and underneath it, four messages that Apache has started. :D

Now I need to burn the BIN files on either CD's or a DVD, whichever the readme file says (I didn't read it yet). :)

Agilo

PermaLink  |  Edit