Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # mktorrent script #
- # making the script executable everywhere
- chmod 755 maketorrent.sh
- cp maketorrent.sh /usr/local/bin/maketorrent
- # then just run
- cd /file/path
- maketorrent filesdir
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- #!/bin/bash
- # removes .torrent file if existes in the path
- rm -f "$1.torrent"
- # trackers urls
- URL1=udp://fr33domtracker.h33t.com:3310/announce
- URL2=http://fr33dom.h33t.com:3310/announce
- URL3=udp://tracker.istole.it:80/announce
- URL4=udp://tracker.publicbt.com:80/announce
- URL5=udp://tracker.openbittorrent.com:80/announce
- # comments
- CMT="seed please"
- # get size from dir
- SIZE=$(du -ms "$1" | awk '{print $1}')
- # set piece size for torrent
- if [ $SIZE -ge 16384 ]; then PIECE=24
- elif [ $SIZE -ge 8192 ]; then PIECE=23
- elif [ $SIZE -ge 4096 ]; then PIECE=22
- elif [ $SIZE -ge 2048 ]; then PIECE=21
- elif [ $SIZE -ge 1024 ]; then PIECE=20
- elif [ $SIZE -ge 512 ]; then PIECE=19
- elif [ $SIZE -lt 512 ]; then PIECE=18
- fi
- echo
- echo -e DIR SIZE IS "\e[92m$SIZE MB\e[0m" THEN PIECE SIZE WILL BE "\e[92m$PIECE\e[0m"
- echo
- # the final command
- mktorrent -v -l $PIECE -a $URL1 -a $URL2 -a $URL3 -a $URL4 -a $URL5 -c "$CMT" -o "$1.torrent" "$1"
- #-v is for verbose
- #-p is for private
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment