LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-16-2012, 08:13 PM   #1
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 271

Rep: Reputation: 6
terminal commands for Ktorrent


Hello,

I did a search online for a ktorrent man page but I seem to be only finding information about the graphical interface.

Is there a way I can change open ports while the program is running through the terminal?

My situation:

I am using a VPN for my main connection but the VPN normally blocks incoming ports. I can get around this by using a utility from them(it opens a port for me and sends me the port number). For linux, however, I need to do this manually and the port number periodically changes on the VPN side.

Finding the port is no problem. The problem is that the port changes from time to time; so I would like to make a cron script that finds the port and then changes it in ktorrent while its still running. Currently I need to always put the port in manually which is not a good option.

What I want to do:In a cron script that runs every hour.

1. Get my port number from my terminal command.
2. Change the ktorrent port number.
 
Old 12-16-2012, 09:03 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
ktorrent is a graphical application designed to work with the KDE desktop. I haven't used it--I tend to use GFTP--but I suspect that it may not be the best candidate for manipulation via a cron job, especially when you are logged out of your desktop. If I'm wrong, I hope someone corrects me; that's how I learn.

This is just a shot in the dark, but it might be easier to work with a command-line application, such as ftp itself.

Last edited by frankbell; 12-16-2012 at 09:05 PM.
 
1 members found this post helpful.
Old 12-16-2012, 09:18 PM   #3
Dman58
Member
 
Registered: Nov 2010
Location: The Danger Zone
Distribution: Slackware & everything else in a VM
Posts: 294

Rep: Reputation: 31
Use rtorrent, its a lightwieght full featured bittorrent client driven by the command line. I just started using it myself, not an expert but from what i read so far it is awesome. Gonna read up on the configuration a little more then get deep into tomorrow.
 
Old 12-17-2012, 08:21 AM   #4
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 271

Original Poster
Rep: Reputation: 6
Frankbell: Thank you for your suggestion but the tracker that I use only allows certain bit-torrent clients.

Dman 58: rtorrent is acceptable for my tracker. Ill take a look at it. Thank you.
 
Old 12-17-2012, 09:02 AM   #5
Dman58
Member
 
Registered: Nov 2010
Location: The Danger Zone
Distribution: Slackware & everything else in a VM
Posts: 294

Rep: Reputation: 31
No problem, happy torrenting!
 
1 members found this post helpful.
Old 12-17-2012, 12:20 PM   #6
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Perhaps qdbus can help you here...

Quote:
Originally Posted by Adol View Post
1. Get my port number from my terminal command.
Code:
$ qdbus org.ktorrent.ktorrent /settings port
6881

Quote:
Originally Posted by Adol View Post
2. Change the ktorrent port number.
Code:
$ qdbus org.ktorrent.ktorrent /settings setPort 6882
$ qdbus org.ktorrent.ktorrent /settings apply
There are many more settings for Ktorrent that can be tweaked with qdbus, run it with only the service name and the "/settings" path to see the list:

Code:
$ qdbus org.ktorrent.ktorrent /settings
 
1 members found this post helpful.
Old 12-17-2012, 05:41 PM   #7
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 271

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Diantre View Post
Perhaps qdbus can help you here...



Code:
$ qdbus org.ktorrent.ktorrent /settings port
6881



Code:
$ qdbus org.ktorrent.ktorrent /settings setPort 6882
$ qdbus org.ktorrent.ktorrent /settings apply
There are many more settings for Ktorrent that can be tweaked with qdbus, run it with only the service name and the "/settings" path to see the list:

Code:
$ qdbus org.ktorrent.ktorrent /settings
That works perfectly.
 
Old 12-17-2012, 08:26 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
Drat, you said ktorrent and my mind read ftp. My apologies.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Terminal commands working in terminal but not in a script GreYFoXGTi Linux - Newbie 1 08-04-2010 09:36 AM
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 10:34 AM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration