Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

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

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


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.