Loading

How to Enable auto shutdown in Transmission with your own script in Linux

Transmission is a simple yet powerful torrent client. It’s available in some of the Linux distributions by default. However, one very important torrent client must have feature is missing in transmission. Now, we are going to add that feature by ourselves with our own shell script. We will make that shell script execute in Transmission after download completes. Let’s first get started by writing a single line shell script for shutdown. Most of you reading this may have used command to restart and shutdown your system. If you don’t know this, yes you can shutdown and restart Linux system from your terminal.

Go to home directory, fire up your text editor, create a file and write a script. I will use vim. Name the file shutdown.sh and add the following code into that file:


sudo -h shutdown now
 
 
Make the file executable:


chmod +x shutdown.sh


That’s all we would include in the script file.
Now, we will need gksu. If it’s not available in your system by default install it. It’s available in the repo of most Linux distributions. For Debian users:


sudo apt-get install gksu
 
 
Drag your Transmission icon in Desktop, right click and under basic heading you will find a command field. Add “gksu command” in that field. Gksu command makes transmission executable as a super user.


Or you can start transmission as a root from the terminal.


sudo transmission


Now, go to Edit> Preferences and under Downloading check on “Call Script when torrent is completed”. Give the path of the script file and that’s it.
However, there’s one hassle in this process. If you are downloading more than one torrent at once, your system will shutdown after completing one download. If you have a way to remove this hassle, share with us as a comment.

0 comments:

Post a Comment

Facebook Badge

 
Design by Cybermoshfiq | Bloggerized by Moshfiqur's Rahman - .