rendered paste body#!/bin/bash#./addtorrentuser.sh user /mnt/hdX quotaGBWINYO=$2USERNEV=$1DISKPACE=$3if [ ${#1} -eq 0 ]; then exitfiif [ ${#2} -eq 0 ]; then exitfiif [ ${#3} -eq 0 ]; then exitfiDISKSPACEGB=`expr $DISKPACE \* 1024 \* 1024`echo "ADDING: user: $USERNEV, PATH: /mnt/$WINYO, SPACE $DISKPACE GB ($DISKSPACEGB kB)"mkdir /mnt/$WINYO/$USERNEVln -s /mnt/$WINYO/$USERNEV /home/torrent/$USERNEVmkdir /home/torrent/$USERNEV/watchmkdir /home/torrent/$USERNEV/downloadadduser -g torrent -G disk,torrent -m $USERNEV -d /home/torrent/$USERNEVpasswd $USERNEVsetquota -u $USERNEV $DISKSPACEGB $DISKSPACEGB 0 0 /mnt/$WINYOchown $USERNEV.torrent -R /mnt/$WINYO/$USERNEVsu -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/$USERNEVchown $USERNEV.torrent -R /home/torrent/$USERNEVscreen -dmS $USERNEV\_ut su -l $USERNEV -c "export DISPLAY=:1.0; wine z://utorrent.exe"