in reply to Automatically running a script

With regards to the network dying when it's unzipping something, typically if you're calling an external program such as bunzip2 to uncompress a file, and the network dies partway through the uncompression process, the bunzip2 process itself will return with an error code.

If you just make sure to check the return status of the uncompression program you'll be able to detect it and re-try the uncompression later.