This repository has been archived on 2020-08-13. You can view files and clone it, but cannot push or open issues/pull-requests.
aria2/entrypoint.sh

32 lines
945 B
Bash
Raw Permalink Normal View History

2019-04-19 19:17:09 +02:00
#!/bin/ash
if ! [ -z $NGINX_LISTEN_SOCKET ]; then
sed -i 's#listen 80#listen unix:/var/run/nginx.sock#' /etc/nginx/conf.d/default.conf
2019-04-22 16:12:00 +02:00
rm -f /var/run/nginx.sock
fi
2019-04-19 19:17:09 +02:00
nginx
2019-05-15 17:29:51 +02:00
ARIA2_URL=http://localhost:6800 su-exec $UID /aria2_exporter &
2019-04-23 23:11:46 +02:00
2019-04-19 19:17:09 +02:00
touch /data/torrents
chown $UID /data/torrents
su-exec $UID aria2c \
--show-console-readout false \
2019-04-22 16:59:42 +02:00
--summary-interval=0 \
2019-04-19 19:17:09 +02:00
--enable-rpc \
--bt-save-metadata \
--bt-load-saved-metadata \
--force-save \
2019-04-22 16:56:24 +02:00
--listen-port=${LISTEN_PORT:-6881-6889} \
2019-04-22 16:59:42 +02:00
--dht-listen-port=${DHT_LISTEN_PORT:-6881-6889} \
2019-04-24 22:16:57 +02:00
--dht-file-path=/data/dht.dat \
--dht-file-path6=/data/dht6.dat \
--max-overall-download-limit=${MAX_OVERALL_DOWNLOAD_LIMIT:-0} \
--max-overall-upload-limit=${MAX_OVERALL_UPLOAD_LIMIT:-0} \
--max-concurrent-downloads 65536 \
2019-04-19 19:17:09 +02:00
--seed-ratio=0 \
2019-05-14 16:45:35 +02:00
--dir /data \
2019-04-19 19:17:09 +02:00
--save-session /data/torrents \
2019-04-22 16:07:20 +02:00
--save-session-interval 900 \
2019-04-19 19:17:09 +02:00
-i /data/torrents