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

The problem: I have an external hard drive and sometimes the driver crashes on startup. It does restart after some time. However my torrent client is also in my startup list and all the data is on the external hard drive. So if the driver fails it fails to find the files and starts downloading them again, eventually it gets an error and so on... So what I want to be able to do is to set up the launcher for the torrent program so that it won't start if the external drive is not present. Is this possible? And how would you go about doing it?

share|improve this question
up vote 3 down vote accepted

You could write a ShellScript that checks if the external-hd is mounted and if so start the torrent-client something like this...


varCheck='mount | grep "/media/external_hd"'
if [[ ${#varCheck} > 0 ]]
   start torrent-client

and then put this in your autostart

share|improve this answer
How didn't I think of this myself... I was thinking about some sort of one line command that would both check and launch the client. – Homulvas Mar 2 '13 at 19:22

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.