mirror of
https://github.com/Jonny007-MKD/Torrent-Label-DB
synced 2025-03-09 15:57:07 +01:00
Adding script for adding torrents in DelugeD
This commit is contained in:
parent
082ddfcd94
commit
534035c52f
1 changed files with 30 additions and 0 deletions
30
delugeAddTorrent.sh
Executable file
30
delugeAddTorrent.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script shall be called by DelugeD in the "On torrent added" action
|
||||||
|
|
||||||
|
PwD=$(readlink -e $0) # Get the path to this script
|
||||||
|
PwD=$(dirname "$PwD")
|
||||||
|
db="$PwD/labelsOfTorrents.db"
|
||||||
|
|
||||||
|
# get arguments from DelugeD
|
||||||
|
torrentid=$1
|
||||||
|
torrentname=$2
|
||||||
|
torrentpath=$3
|
||||||
|
|
||||||
|
#echo "Date: `date`" >> "$PwD/log"
|
||||||
|
#echo "TorrentID: $torrentid" >> "$PwD/log"
|
||||||
|
#echo "TorrentName: $torrentname" >> "$PwD/log"
|
||||||
|
#echo "TorrentPath: $torrentpath" >> "$PwD/log"
|
||||||
|
#echo "I am: `whoami`" >> "$PwD/log"
|
||||||
|
#echo "" >> "$PwD/log"
|
||||||
|
|
||||||
|
if (( $# == 0 )); then # no arguments!?
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$(grep $torrentid $db)" ]; then # torrent already exists
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$(date +%s) deluge $torrentid $torrentname " >> $db
|
||||||
|
|
Loading…
Reference in a new issue