[Aria2] Update install script

This commit is contained in:
Sam Heinz 2024-04-18 17:13:09 +10:00
parent 1f217ea51f
commit 2d85f6a689
No known key found for this signature in database
GPG key ID: C71634079A15FA88

View file

@ -35,8 +35,8 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
service_path="/etc/systemd/system/ariang.service" service_path="/etc/systemd/system/ariang.service"
cat <<EOF >/etc/nginx/conf.d/ariang.conf cat <<EOF >/etc/nginx/conf.d/ariang.conf
server { server {
listen 80 default_server; listen 6880 default_server;
listen [::]:80 default_server; listen [::]:6880 default_server;
server_name _; server_name _;
@ -48,13 +48,29 @@ server {
} }
} }
EOF EOF
rm /etc/nginx/sites-enabled/*
systemctl restart nginx systemctl restart nginx
msg_ok "Installed AriaNG" msg_ok "Installed AriaNG"
fi fi
msg_info "Creating Service" msg_info "Creating Service"
service_path="/etc/systemd/system/aria2.service" mkdir /root/downloads
cat <<EOF >/root/aria2.daemon
continue
dir=/root/downloads
file-allocation=falloc
max-connection-per-server=4
max-concurrent-downloads=2
max-overall-download-limit=0
min-split-size=25M
rpc-allow-origin-all=true
rpc-secret=YouShouldChangeThis
input-file=/var/tmp/aria2c.session
save-session=/var/tmp/aria2c.session
EOF
cat <<EOF >/etc/systemd/system/aria2.service
echo '[Unit] echo '[Unit]
Description=Aria2c download manager Description=Aria2c download manager
After=network.target After=network.target
@ -69,20 +85,7 @@ TimeoutStopSec=20
Restart=on-failure Restart=on-failure
[Install] [Install]
WantedBy=multi-user.target' >$service_path WantedBy=multi-user.target'
cat <<EOF >/root/aria2.daemon
continue
dir=/var/www/downloads
file-allocation=falloc
max-connection-per-server=4
max-concurrent-downloads=2
max-overall-download-limit=0
min-split-size=25M
rpc-allow-origin-all=true
rpc-secret=YouShouldChangeThis
input-file=/var/tmp/aria2c.session
save-session=/var/tmp/aria2c.session
EOF EOF
systemctl enable --now -q aria2.service systemctl enable --now -q aria2.service