TorrentFlux-b4rt transmissioncli problem with transfer port

Torrenflux-b4rt es un port de torrentflux. pero con algunas ventajas.

es un frontend para los clientes de torrent , news, o wget. una de las facilidades que tiene es el manejo de todo por web en un servidor remoto.

Al usar el cliente transmissioncli tiene problemas con el puerto que asigna para las transferencias. por lo que realize una pequena modificacion que permite corregir.


transmissioncli -v
Transmission 1.76 (9395) - http://www.transmissionbt.com/ - modified for Torrentflux-b4rt

Creamos un bash script para determinar el puerto que usaremos para transferencia.


vi /usr/local/bin/transferport

#!/bin/bash
PORT=`netstat -e -l -p --tcp --numeric-hosts --numeric-ports |grep transmissioncl|awk -F: '{print $2}'|awk '{print $1}'|sort -n|tail -1|grep -v 9091`
let PATO=$PORT+1

if [ "$PATO" = "1" ]
then
 echo "50000"
else
 echo $PATO
fi

Guardamos el archivo y le asignamos permisos de ejecucion

chmod 755 /usr/local/bin/transferport 

Ahora debemos editar en panel web de torrentflux-b4rt

Editamos el siguente archivo

inc/classes/ClientHandler.transmission.php

el contenido que debe buscar es


$this->command  = "cd ".tfb_shellencode($this->savepath).";";
 $this->command .= " HOME=".tfb_shellencode($cfg["path"])."; export HOME;".
 $this->command .= $this->umask;
 $this->command .= " nohup ";
 $this->command .= $this->nice;
 $this->command .= tfb_shellencode($cfg["btclient_transmission_bin"]);
 $this->command .= " -d ".tfb_shellencode($this->drate);
 $this->command .= " -u ".tfb_shellencode($this->rate);
 $this->command .= " -p ".tfb_shellencode($this->port);
 $this->command .= " -W ".tfb_shellencode(($this->runtime == "True") ? 1 : 0);
 $this->command .= " -L ".tfb_shellencode($this->sharekill_param);
 $this->command .= " -E 6";
 $this->command .= " -O ".tfb_shellencode($this->owner);
 if (strlen($cfg["btclient_transmission_options"]) > 0)
 $this->command .= " ".$cfg["btclient_transmission_options"];
 $this->command .= " ".tfb_shellencode($this->transferFilePath);
 $this->command .= " 1>> ".tfb_shellencode($this->transferFilePath.".log");
 $this->command .= " 2>> ".tfb_shellencode($this->transferFilePath.".log");
 $this->command .= " &";

Borramos la linea que hace referencia al puerto de transferencia


$this->command  = "cd ".tfb_shellencode($this->savepath).";";
 $this->command .= " HOME=".tfb_shellencode($cfg["path"])."; export HOME;".
 $this->command .= $this->umask;
 $this->command .= " nohup ";
 $this->command .= $this->nice;
 $this->command .= tfb_shellencode($cfg["btclient_transmission_bin"]);
 $this->command .= " -d ".tfb_shellencode($this->drate);
 $this->command .= " -u ".tfb_shellencode($this->rate);
 $this->command .= " -W ".tfb_shellencode(($this->runtime == "True") ? 1 : 0);
 $this->command .= " -L ".tfb_shellencode($this->sharekill_param);
 $this->command .= " -E 6";
 $this->command .= " -O ".tfb_shellencode($this->owner);
 if (strlen($cfg["btclient_transmission_options"]) > 0)
 $this->command .= " ".$cfg["btclient_transmission_options"];
 $this->command .= " ".tfb_shellencode($this->transferFilePath);
 $this->command .= " 1>> ".tfb_shellencode($this->transferFilePath.".log");
 $this->command .= " 2>> ".tfb_shellencode($this->transferFilePath.".log");
 $this->command .= " &";

TorrentFlux

TorrentFlux-b4rt

El proximo post sera sobre el envio de correo cuando un torrent baje.

This entry was posted in General, blog. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.

  • Pages

  • Categories

  • Archives