Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Combined with a crontab job, looks regularly for torrent files in a f…

…older and start downloads automaticcaly.
  • Loading branch information...
commit 8870de6440301975860aa460db4da037c1457c43 1 parent 11b7e30
@kdeldycke authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 mldonkey-auto-download.sh
View
22 mldonkey-auto-download.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Path of the temporary repository where people upload their torrents file
+P="/mnt/bigdisk/torrent_to_download"
+
+# Be sure mldonkey will be able to process files
+chown -R mldonkey:root $P
+
+# Get the list of all files in the repository
+files=`ls $P`
+
+# Send each file to mldonkey
+for torrent_name in $files; do
+ tor=$P/$torrent_name
+ # TODO: do url encoding here
+ wget -q -O /dev/null "http://localhost:4080/submit?q=dllink+$tor"
+ # TODO: do not remove if mldonkey doesn't accept the torrent
+ rm -f $tor
+ done
+
+# Let everybody upload new torrent files to the repository
+chmod -R 666 $P
Please sign in to comment.
Something went wrong with that request. Please try again.