
0day
By: a guest on
Apr 30th, 2012 | syntax:
Bash | size: 1.33 KB | hits: 57 | expires: Never
#!/bin/bash
#iblicf
Tracker="http://tracker.sjtu.edu.cn/announce.php"
watchdir="/root/rtorrent/session"
_0day=$(basename "$PWD")
which mktorrent &>/dev/null || exit
which unrar &>/dev/null || exit
if [ ! -e *.rar ]; then
echo -e "\tThere have no 0day's *.rar ~~~"
exit
fi
[ -z "$1" ] || Tracker=$1
echo "============================================================"
echo "Name: $_0day"
echo "Tracker: $Tracker"
echo "============================================================"
if [ -d ./temp ];then
#rm -rf ./temp/*
echo -e "\tCaution: already has <temp> folder!"
exit
else
mkdir -p "./temp/$_0day"
echo -e "\n\t1) Unrar ing..."
unrar -o+ -c- x *.rar "./temp/$_0day/" #&>/dev/null
if [ $? -ne 0 ]; then
echo -e "\tSomething wrong while doing unrar ~~~"
exit
fi
fi
[ "$?" -eq 0 ] || echo -e "\tWhat??? ~~~"
if [ -d "./temp/$_0day" ]; then
cp *.nfo "./temp/$_0day/" &>/dev/null
pushd ./temp &>/dev/null
rm -rf *.torrent
echo -e "\n\t2) Now make torrent ..."
mktorrent -p -a $Tracker $_0day
popd &>/dev/null
else
echo -e "\tno mktorrent!"
fi
wait
#echo -e "\t$DIRSTACK"
mv -f ./temp/$_0day/* . &>/dev/null
cp -f ./temp/*.torrent . &>/dev/null
rm -rf ./temp &>/dev/null
#cp ./temp/*.torrent $Watch_dir
echo -e "\n\t***WE DONE!!!***"