Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a script to automatically connect to a server and want it to run each time I login with my user account. If possible make the script wait a few seconds to connect until the network can be connected.

share|improve this question

2 Answers 2

up vote 2 down vote accepted
#!/bin/bash

sleep 11 &&

<your_script> -c ~/.<your_scriptrc>

#!/bin/bash tells the computer you want it to do the following in bash, sleep 11 && tells the computer to wait 11 seconds

(increase or decrease the time as needed).

share|improve this answer

this is a very basic example of the script

sleep 10
YOUR COMMAND HERE

what the sleep 10 does it waits for 10 seconds then it continues the script.
i don't know which commands your using to connect to a server so that part is up to you

go to the above right screen select startup
select add typ in a name and search where you saved the file and a comment if you like

you can also make it generate a log file like so
YOUR COMMAND HERE>>serverlogin.log
you can change it to where you want so save the log like so

YOUR COMMAND HERE>>/tmp/serverlogin.log
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.