[gimp-web] downloads: add script for creation torrent files
- From: Michael Schumacher <schumaml src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-web] downloads: add script for creation torrent files
- Date: Thu, 11 Jun 2020 19:09:27 +0000 (UTC)
commit 4be8610aab1f2e610b2aed3e4203989a020e96fe
Author: Michael Schumacher <schumaml gmx de>
Date: Thu Jun 11 19:05:16 2020 +0200
downloads: add script for creation torrent files
Needs mktorrent to be installed, and relies on downloads.http.txt
to be in the same directory for now.
tools/downloads/mt | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
---
diff --git a/tools/downloads/mt b/tools/downloads/mt
new file mode 100755
index 00000000..75455aca
--- /dev/null
+++ b/tools/downloads/mt
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+OPTIND=1
+
+tracker1=udp://tracker.opentrackr.org:1337/announce
+tracker2=udp://tracker.coppersurfer.tk:6969/announce
+tracker3=udp://tracker.leechers-paradise.org:6969/announce
+
+while getopts "c:o:p:" opt; do
+ case "$opt" in
+ c)
+ comment=$OPTARG
+ ;;
+ o)
+ outfile=$OPTARG
+ ;;
+ p)
+ localpath=$OPTARG
+ ;;
+ esac
+done
+
+shift $((OPTIND-1))
+
+[ "$1" = "--" ] && shift
+
+echo "comment=$comment; outfile=$outfile; localpath=$localpath; 1=$1; rest=$@"
+
+rawurllist=`cat ./downloads.http.txt | xargs | sed -e 's/ /localpath,/g' | sed -e 's/$/localpath/'`
+# currentpath=`readlink -f $1 | sed -e 's_/srv/ftp/pub/gimp/__'`
+# localpath=`dirname $currentpath`
+
+urllist=`echo $rawurllist | sed -e 's@localpath@'"$localpath/"'@g'`
+
+echo mktorrent -a $tracker1 -a $tracker2 -a $tracker3 -w $urllist -c \"$comment\" $1
+mktorrent -a $tracker1 -a $tracker2 -a $tracker3 -w $urllist -c "$comment" $1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]