ControlScripts: add start scripts for hrktorrent using client-based download/upload...
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 9 Aug 2010 16:31:07 +0000 (19:31 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 9 Aug 2010 16:31:07 +0000 (19:31 +0300)
ControlScripts/clients/hrk/start_hrk_leecher_limit.sh [new file with mode: 0755]
ControlScripts/clients/hrk/start_hrk_seeder_limit.sh [new file with mode: 0755]

diff --git a/ControlScripts/clients/hrk/start_hrk_leecher_limit.sh b/ControlScripts/clients/hrk/start_hrk_leecher_limit.sh
new file mode 100755 (executable)
index 0000000..de65c02
--- /dev/null
@@ -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 (executable)
index 0000000..ce7a728
--- /dev/null
@@ -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