This repository has been archived on 2020-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
aria2/entrypoint.sh
Simon Bruder d9778d34a6
All checks were successful
continuous-integration/drone/push Build is passing
run aria2 exporter as non-root user
2019-05-15 15:29:51 +00:00

32 lines
945 B
Bash
Executable file

#!/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
rm -f /var/run/nginx.sock
fi
nginx
ARIA2_URL=http://localhost:6800 su-exec $UID /aria2_exporter &
touch /data/torrents
chown $UID /data/torrents
su-exec $UID aria2c \
--show-console-readout false \
--summary-interval=0 \
--enable-rpc \
--bt-save-metadata \
--bt-load-saved-metadata \
--force-save \
--listen-port=${LISTEN_PORT:-6881-6889} \
--dht-listen-port=${DHT_LISTEN_PORT:-6881-6889} \
--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 \
--seed-ratio=0 \
--dir /data \
--save-session /data/torrents \
--save-session-interval 900 \
-i /data/torrents