From 86d874625f6221a3261e36a3f5b50decf60b5459 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Mon, 9 Aug 2010 19:31:07 +0300 Subject: [PATCH] ControlScripts: add start scripts for hrktorrent using client-based download/upload limitation --- .../clients/hrk/start_hrk_leecher_limit.sh | 43 +++++++++++++++++++ .../clients/hrk/start_hrk_seeder_limit.sh | 41 ++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100755 ControlScripts/clients/hrk/start_hrk_leecher_limit.sh create mode 100755 ControlScripts/clients/hrk/start_hrk_seeder_limit.sh diff --git a/ControlScripts/clients/hrk/start_hrk_leecher_limit.sh b/ControlScripts/clients/hrk/start_hrk_leecher_limit.sh new file mode 100755 index 0000000..de65c02 --- /dev/null +++ b/ControlScripts/clients/hrk/start_hrk_leecher_limit.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# 2010 Razvan Deaconescu, razvan.deaconescu@cs.pub.ro +# +# Bash script used to start a hrktorrent instance +# The script +# * changes current working directory to Regular +# * starts a hrktorrent session - use LD_LIBRARY_PATH to point to +# libtorrent-rasterbar location +# * at the end deletes the downloaded data +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# + +if test $# -ne 2; then + echo "Usage: $0 download-limit(kb/s) upload-limit(kb/s)" 1>&2 + exit 1 +fi + +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e globalconfig ]; then + echo "Warning: The global config file globalconfig does not exist." +else + source globalconfig +fi + +# Read the node-specific configuration file (TORRENT_FILE) +# Check if the node-specific configuration file exists +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." +else + source ../ClientWorkingFolders/TmpLogs/node_config +fi + +cd $WORKING_FOLDER_REL_PATH/Regular/ + +KB_DOWN_LIMIT=$1 +KB_UP_LIMIT=$2 + +LD_LIBRARY_PATH=$HRK_ABS_PATH/../libtorrent-rasterbar/lib $HRK_ABS_PATH/hrktorrent --maxdown${KB_DOWN_LIMIT} --maxup${KB_UP_LIMIT} ../TorrentsAndData/$TORRENT_FILE + +rm -rf * diff --git a/ControlScripts/clients/hrk/start_hrk_seeder_limit.sh b/ControlScripts/clients/hrk/start_hrk_seeder_limit.sh new file mode 100755 index 0000000..ce7a728 --- /dev/null +++ b/ControlScripts/clients/hrk/start_hrk_seeder_limit.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# 2010 Razvan Deaconescu, razvan.deaconescu@cs.pub.ro +# +# Bash script used to start a hrktorrent instance +# The script +# * changes current working directory to TorrentsAndData +# * starts a hrktorrent session - use LD_LIBRARY_PATH to point to +# libtorrent-rasterbar location +# * at the end deletes the downloaded data +# +# If you run this script manually, you must run it from the P2P-Testing-Infrastructure/ControlScripts folder +# + +if test $# -ne 2; then + echo "Usage: $0 download-limit(kb/s) upload-limit(kb/s)" 1>&2 + exit 1 +fi + +# Read the global configuration file +# Check if the global configuration file exists +if [ ! -e globalconfig ]; then + echo "Warning: The global config file globalconfig does not exist." +else + source globalconfig +fi + +# Read the node-specific configuration file (TORRENT_FILE) +# Check if the node-specific configuration file exists +if [ ! -e ../ClientWorkingFolders/TmpLogs/node_config ]; then + echo "Warning: The global config file ../ClientWorkingFolders/TmpLogs/node_config does not exist." +else + source ../ClientWorkingFolders/TmpLogs/node_config +fi + +cd $WORKING_FOLDER_REL_PATH/TorrentsAndData/ + +KB_DOWN_LIMIT=$1 +KB_UP_LIMIT=$2 + +$LD_LIBRARY_PATH=$HRK_ABS_PATH/../libtorrent-rasterbar/lib $HRK_ABS_PATH/hrktorren --maxdown${KB_DOWN_LIMIT} --maxup${KB_UP_LIMIT} $TORRENT_FILE -- 2.20.1