From 236783dd77d6277fbc925f0dcd5542607d3e4379 Mon Sep 17 00:00:00 2001 From: p2p p2p-next-02 Date: Tue, 3 May 2011 11:55:16 +0300 Subject: [PATCH] transmission support almost ready --- ControlScripts/client_script_mappings | 17 +++++++++++++++++ .../detect_complete_transmission.sh | 6 +++--- .../clients/transmission/parse_transmission.sh | 2 +- .../transmission/start_transmission_leecher.sh | 5 ++++- .../transmission/start_transmission_seeder.sh | 5 ++++- .../clients/transmission/stop_transmission.sh | 2 +- ControlScripts/globalconfig | 3 +++ TestSpecs/gen/transmission_test_01.csv | 2 ++ 8 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 TestSpecs/gen/transmission_test_01.csv diff --git a/ControlScripts/client_script_mappings b/ControlScripts/client_script_mappings index ffd19ec..95edac4 100644 --- a/ControlScripts/client_script_mappings +++ b/ControlScripts/client_script_mappings @@ -38,6 +38,14 @@ start_client() clients/hrk/start_hrk_leecher_limit.sh ${download_limit} ${upload_limit} ${connection_limit} & return $! ;; + "transmission_seeder") + clients/transmission/start_transmission_seeder.sh & + return $! + ;; + "transmission_leecher") + clients/transmission/start_transmission_leecher.sh & + return $! + ;; "tribler_seeder") clients/tribler/start_tribler_seeder.sh & return $! @@ -90,6 +98,9 @@ stop_client() "hrktorrent_seeder" | "hrktorrent_leecher" | "hrktorrent_seeder_limit" | "hrktorrent_leecher_limit") clients/hrk/stop_hrk.sh ;; + "transmission_seeder" | "transmission_leecher") + clients/transmission/stop_transmission.sh + ;; "tribler_seeder") clients/tribler/stop_tribler.sh ;; @@ -130,6 +141,9 @@ detect_complete_client() "hrktorrent_seeder" | "hrktorrent_leecher" | "hrktorrent_seeder_limit" | "hrktorrent_leecher_limit") clients/hrk/detect_complete_hrk.sh ${log_file} ;; + "transmission_seeder" | "transmission_leecher") + clients/transmission/detect_complete_transmission.sh ${log_file} + ;; "tribler_seeder") clients/tribler/detect_complete_tribler_seeder.sh ${log_file} ;; @@ -169,6 +183,9 @@ parse_client_log() DEBUG echo "hello hrktorrent_seeder" clients/hrk/parse_hrk.sh ${log_folder} ${log_file} ;; + "transmission_seeder" | "transmission_leecher") + clients/swift/parse_swift.sh ${log_folder} ${log_file} + ;; "tribler_seeder") clients/tribler/parse_tribler.sh ${log_folder} ${log_file} ;; diff --git a/ControlScripts/clients/transmission/detect_complete_transmission.sh b/ControlScripts/clients/transmission/detect_complete_transmission.sh index 19e36a7..b94d98c 100755 --- a/ControlScripts/clients/transmission/detect_complete_transmission.sh +++ b/ControlScripts/clients/transmission/detect_complete_transmission.sh @@ -24,7 +24,7 @@ LOG_FILE=$1 while true; do # check for complete transfer - if cat $LOG_FILE | grep "Torrent finished" &> /dev/null; then + if cat $LOG_FILE | grep 'State changed from "Incomplete" to "Complete"' &> /dev/null; then echo "Torrent transfer finished" exit 0 fi @@ -35,9 +35,9 @@ while true; do fi # check stat client is alive - if ! pgrep "hrktorrent" &> /dev/null; then + if ! pgrep -f "transmission-cli" &> /dev/null; then if ! pgrep -f "schedule_client.sh" &> /dev/null; then - echo "No hrktorrent and no schedule_client.sh process" + echo "No transmission-cli and no schedule_client.sh process" exit 0 fi fi diff --git a/ControlScripts/clients/transmission/parse_transmission.sh b/ControlScripts/clients/transmission/parse_transmission.sh index c25eb24..39d25ed 100755 --- a/ControlScripts/clients/transmission/parse_transmission.sh +++ b/ControlScripts/clients/transmission/parse_transmission.sh @@ -9,7 +9,7 @@ # * the name of a log file in that folder # # Sample run: -# ./parse_hrk.sh ../../../Results/samples/ p2p-next-01-101.log +# ./parse_transmission.sh ../../../Results/samples/ p2p-next-01-101.log if [ ! $# -eq 2 ]; then echo "usage: $0 log-folder log-file" diff --git a/ControlScripts/clients/transmission/start_transmission_leecher.sh b/ControlScripts/clients/transmission/start_transmission_leecher.sh index f725452..205682f 100755 --- a/ControlScripts/clients/transmission/start_transmission_leecher.sh +++ b/ControlScripts/clients/transmission/start_transmission_leecher.sh @@ -27,8 +27,11 @@ else source ../ClientWorkingFolders/TmpLogs/node_config fi +rm ~/.config/tramsmission/resume/* +rm ~/.config/tramsmission/torrents/* + cd $WORKING_FOLDER_REL_PATH/Regular/ -LD_LIBRARY_PATH=$HRK_ABS_PATH/../libtorrent-rasterbar/lib $HRK_ABS_PATH/hrktorrent --nodht ../TorrentsAndData/$TORRENT_FILE +$TRANSMISSION_ABS_PATH/transmission-cli ../TorrentsAndData/$TORRENT_FILE -w . rm -rf * diff --git a/ControlScripts/clients/transmission/start_transmission_seeder.sh b/ControlScripts/clients/transmission/start_transmission_seeder.sh index 0e81927..cc7129b 100755 --- a/ControlScripts/clients/transmission/start_transmission_seeder.sh +++ b/ControlScripts/clients/transmission/start_transmission_seeder.sh @@ -27,6 +27,9 @@ else source ../ClientWorkingFolders/TmpLogs/node_config fi +rm ~/.config/tramsmission/resume/* +rm ~/.config/tramsmission/torrents/* + cd $WORKING_FOLDER_REL_PATH/TorrentsAndData/ -LD_LIBRARY_PATH=$HRK_ABS_PATH/../libtorrent-rasterbar/lib $HRK_ABS_PATH/hrktorrent --nodht --nohashcheck $TORRENT_FILE +$TRANSMISSION_ABS_PATH/transmission-cli $TORRENT_FILE -w . diff --git a/ControlScripts/clients/transmission/stop_transmission.sh b/ControlScripts/clients/transmission/stop_transmission.sh index b0f31f7..dbc76b3 100755 --- a/ControlScripts/clients/transmission/stop_transmission.sh +++ b/ControlScripts/clients/transmission/stop_transmission.sh @@ -11,4 +11,4 @@ if [ ! $# -eq 0 ]; then exit 1 fi -pkill -KILL -f hrktorrent +pkill -KILL -f transmission-cli diff --git a/ControlScripts/globalconfig b/ControlScripts/globalconfig index df992f2..c281317 100644 --- a/ControlScripts/globalconfig +++ b/ControlScripts/globalconfig @@ -31,6 +31,9 @@ HRK_ABS_PATH="/home/p2p/p2p-clients/hrktorrent/hrktorrent" # hrktorrent with logging support HRK_LOG_ABS_PATH="/home/p2p/p2p-clients/hrktorrent-logging/hrktorrent" +# TRANSMISSION_PATH +TRANSMISSION_ABS_PATH="/home/p2p/p2p-clients/transmission/cli" + # XBTUT_PATH XBTUT_ABS_PATH="/home/p2p/export/unified-tracker/trunk/xbt/Tracker" diff --git a/TestSpecs/gen/transmission_test_01.csv b/TestSpecs/gen/transmission_test_01.csv new file mode 100644 index 0000000..beabd0a --- /dev/null +++ b/TestSpecs/gen/transmission_test_01.csv @@ -0,0 +1,2 @@ +1,1,1,2,Nelimitat,1 Mbit/s,1 Mbit/s,64M,TODO +2,1,3,4,Nelimitat,8 Mbit/s,8 Mbit/s,64M,TODO -- 2.20.1