#!/bin/bash #./addtorrentuser.sh user /mnt/hdX quotaGB WINYO=$2 USERNEV=$1 DISKPACE=$3 if [ ${#1} -eq 0 ]; then exit fi if [ ${#2} -eq 0 ]; then exit fi if [ ${#3} -eq 0 ]; then exit fi DISKSPACEGB=`expr $DISKPACE \* 1024 \* 1024` echo "ADDING: user: $USERNEV, PATH: /mnt/$WINYO, SPACE $DISKPACE GB ($DISKSPACEGB kB)" mkdir /mnt/$WINYO/$USERNEV ln -s /mnt/$WINYO/$USERNEV /home/torrent/$USERNEV mkdir /home/torrent/$USERNEV/watch mkdir /home/torrent/$USERNEV/download adduser -g torrent -G disk,torrent -m $USERNEV -d /home/torrent/$USERNEV passwd $USERNEV setquota -u $USERNEV $DISKSPACEGB $DISKSPACEGB 0 0 /mnt/$WINYO chown $USERNEV.torrent -R /mnt/$WINYO/$USERNEV su -l $USERNEV -c "export DISPLAY=:1.0; wine z://wget.exe" cp /root/utorrent_files/* "/home/torrent/$USERNEV/.wine/drive_c/windows/profiles/$USERNEV/Application Data/uTorrent/" chown $USERNEV.torrent -R /mnt/$WINYO/$USERNEV chown $USERNEV.torrent -R /home/torrent/$USERNEV screen -dmS $USERNEV\_ut su -l $USERNEV -c "export DISPLAY=:1.0; wine z://utorrent.exe"