I'm using deluge 1.0.5 and would like to know how (if there is any way) to know which random port numper is deluge using.
I want to do a script/crontab for filtering RST packets that my isp is known to use, to drop it's clients bittorrent connections.
As the port is random, I got stuck on the <iptables..... --dport ?????>.
I've got a _not_very_nice_ solution grepping netstat, but I'm quite sure deluge must write down it's port somewhere, am I right?
Regards
how to grep (or something else) for current random port.
Re: how to grep (or something else) for current random port.
Well you can monitor the deluged.log file when the port is changed or you enable random port assignment you get something like:
I think it's enough for your scripting needs
Code: Select all
[DEBUG ] 19:46:32 core:749 random port value set to True
[DEBUG ] 19:46:32 core:763 listen port range set to 50228-50238
[DEBUG ] 19:46:32 core:716 config_value_changed signal emitted
[DEBUG ] 19:46:32 alertmanager:101 listen_succeeded_alert: successfully listening on 0.0.0.0:50228
[DEBUG ] 19:46:32 alertmanager:101 listen_succeeded_alert: successfully listening on [::]:50228
Re: how to grep (or something else) for current random port.
Code: Select all
#!/usr/bin/env python
import logging
logging.disable(logging.INFO)
from deluge.ui.client import sclient
sclient.set_core_uri()
print sclient.get_listen_port()
dev: webui, core, labels | irc:vonck7 |