#!/bin/sh DIR="/home/sdk/.aria2" mkdir -p "$DIR" SECOPTS="\ --bt-enable-lpd=false --enable-peer-exchange=false --enable-dht=false --enable-dht6=false " PUBLIC="\ --dht-listen-port=55500 --bt-enable-lpd=true --enable-peer-exchange=true --enable-dht=true --enable-dht6=true " DEFAULT="\ --auto-save-interval=60 --listen-port=55500 --disk-cache=256M --bt-save-metadata=true --bt-load-saved-metadata=true --bt-prioritize-piece=head=10M,tail=10M --content-disposition-default-utf8=true --dht-file-path=$DIR/dht.dat --dht-file-path6=$DIR/dht6.dat --save-cookies=$DIR/cookies.dat --save-session=$DIR/session.dat " for cmd in $@ do case $cmd in seed|upload|up) OPTS="$OPTS --seed-ratio=0.0 --max-overall-upload-limit=5M --max-overall-download-limit=200K --check-integrity=true --bt-hash-check-seed=true --bt-seed-unverified=true -j 100 " shift ;; download|dl) OPTS="$OPTS --max-overall-upload-limit=200K --max-overall-download-limit=85M --seed-time=0 --lowest-speed-limit=30K --bt-request-peer-speed-limit=100K --file-allocation=trunc -j 6 " shift ;; overwrite|force) OPTS="$OPTS --allow-overwrite=true " shift ;; enc|encrypt) OPTS="$OPTS --bt-require-crypto --bt-min-crypto-level=arc4 " shift ;; pub|public) SECOPTS="$PUBLIC" shift ;; seq|1) OPTS="$OPTS -j 1 -Z " shift ;; esac done set -x if [ -z "$@" ] then aria2c $DEFAULT $OPTS $SECOPTS *.torrent else aria2c $DEFAULT $OPTS $SECOPTS "$@" fi