Új hozzászólás Aktív témák

  • Bernath

    tag

    Egy kis segítség kellene a linux guruktól:)) A transmissiont szeretném rávenni,hogy a letöltött filet tömörítse ki,s ezt találtam ez működhet?

    #!/bin/sh
    # 23 Feb 2009
    DownloadDir=`xml sel -T -t -v "/freenas/bittorrent/downloaddir" /conf/config.xml`
    PublicDir="/mnt/mount/public/"
    PORT=9091 # Transmission-daemon port
    USER=admin
    PASS=freenas
    UNRAR=/root/sbin/unrar # If unrar is not in $PATH set path to unrar
    #
    # Make torrent directory if not exist
    if [ ! -d "${PublicDir}" ];then mkdir -p "${PublicDir}" ;fi
    # Read torrent status
    /usr/local/bin/transmission-remote $PORT -l -n $USER:$PASS | \
    while read ID Done ETA Up Down Ratio Status Name
    do
    # If torrent is completly download is Done , process file
    if [ $ETA = "Done" ] ;then
    # Process rar files only , no directory
    if [ -f "${DownloadDir}${Name}" -a "${Name##*.}" = "rar" -a ! -d "${PublicDir}${Name##*.}" ]; then
    mkdir -m 755 "${PublicDir}${Name##*.}" && \
    $UNRAR e "${DownloadDir}${Name}" "${PublicDir}${Name##*.}/";
    # Process directory
    else
    if [ ! -d "${PublicDir}${Name}" ]; then
    # Copy torrent directory to public directory
    cp -R "${DownloadDir}${Name}" "${PublicDir}" && \
    cd "${PublicDir}${Name}" && \
    find . -type f -name "*.rar" -exec $UNRAR e {} \;
    fi
    fi
    fi
    done
    exit 0

Új hozzászólás Aktív témák