forked from wahyd4/aria2-ariang-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharia2c.sh
30 lines (25 loc) · 1.01 KB
/
aria2c.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash -eu
echo "Run aria2c and ariaNG"
if [ "$ENABLE_AUTH" = "true" ]; then
echo "Using Basic Auth config file "
CADDY_FILE=/usr/local/caddy/SecureCaddyfile
else
echo "Using caddy without Basic Auth"
CADDY_FILE=/usr/local/caddy/Caddyfile
fi
if [ "$SSL" = "true" ]; then
echo "Start aria2 with secure config"
/usr/bin/aria2c --conf-path="/root/conf/aria2.conf" -D \
--enable-rpc --rpc-listen-all \
--rpc-certificate=/root/conf/key/aria2.crt \
--rpc-private-key=/root/conf/key/aria2.key \
--rpc-secret="$RPC_SECRET" --rpc-secure \
&& (nohup sh -c "/usr/local/bin/filebrowser -p 8080 -d /root/filebrowser.db -l /var/log/file-browser/out.log -r /data" &)\
&& /usr/local/bin/caddy -quic --conf ${CADDY_FILE}
else
echo "Start aria2 with standard mode"
/usr/bin/aria2c --conf-path="/root/conf/aria2.conf" -D \
--enable-rpc --rpc-listen-all \
&& (nohup sh -c "/usr/local/bin/filebrowser -p 8080 -d /root/filebrowser.db -l /var/log/file-browser/out.log -r /data" &)\
&& /usr/local/bin/caddy -quic --conf ${CADDY_FILE}
fi