I want to download a file Ttytter using wget and run it in the terminal. I can do that by gnome-terminal --tab -e 'wget http://www.floodgap.com/software/ttytter/dist2/2.0.02.txt -O /tmp/ttytter.pl && perl /tmp/ttytter.pl -hold' but if my connection is not established then how do I make wget to wait till connection established and then download the file.
|
|
|||
|
|
I think the best thing to do would be to write a script which pinged the url until it was available and then launched your command when the link came up. The script could use a while loop for the ping command, and when the url was available, the loop could be broken and your command would be run. There are some good scripts here, which could be adapted and which explain the process in detail. Good news, I have just tested the script below by going off-line and then coming back on again and it gives me a copy of
Once you have saved this script and made it executable, you can simply add it as a startup item using the graphical startup manager (but remember to check the option to run as an application in the terminal). Alternatively, put this command in the appropriate area of the box provided by the startup manager: If you have any problems with placing the script in startup, you can create a |
|||||||||||||||
|