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.

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

1 Answer 1

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...

#!/bin/bash

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

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

 
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.