ControlScripts: rename and update regular hrktorrent start script
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 30 Jul 2010 11:00:23 +0000 (14:00 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 30 Jul 2010 11:00:23 +0000 (14:00 +0300)
ControlScripts/start_hrk.sh [deleted file]
ControlScripts/start_hrk_regular.sh [new file with mode: 0755]

diff --git a/ControlScripts/start_hrk.sh b/ControlScripts/start_hrk.sh
deleted file mode 100755 (executable)
index 99be633..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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 hrktorrent working directory
-#  * starts a hrktorrent session - use LD_LIBRARY_PATH to point to
-#    libtorrent-rasterbar location
-
-# Read the global configuration variables
-source ../ConfigFiles/globalconfig.txt
-
-cd $HRK_ABS_PATH
-
-LD_LIBRARY_PATH=../libtorrent-rasterbar/lib ./hrktorrent
diff --git a/ControlScripts/start_hrk_regular.sh b/ControlScripts/start_hrk_regular.sh
new file mode 100755 (executable)
index 0000000..1f80043
--- /dev/null
@@ -0,0 +1,30 @@
+#!/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
+#
+# Script arguments:
+#  * .torrent file
+
+if [ ! $# -eq 1 ]; then
+       echo "usage: $0 torrent-file"
+       exit 1
+fi
+
+# Read the global configuration variables
+source ../ConfigFiles/globalconfig.txt
+
+# Read arguments
+TORRENT_FILE=$1
+
+cd $WORKING_FOLDER_REL_PATH/Regular/
+
+LD_LIBRARY_PATH=$HRK_ABS_PATH/../libtorrent-rasterbar/lib $HRK_ABS_PATH/hrktorrent $WORKING_FOLDER_REL_PATH/TorrentsAndData/$TORRENT_FILE
+
+rm -rf $WORKING_FOLDER_REL_PATH/Regular/*