From 9edb28a374bc5eba88f76949ce8af15010115cd5 Mon Sep 17 00:00:00 2001
From: Sam Heinz <54530346+asylumexp@users.noreply.github.com>
Date: Thu, 18 Apr 2024 17:41:47 +1000
Subject: [PATCH] [Aria2] Create AriaNG service and silence unzip

---
 ct/aria2.sh              | 8 +++++---
 install/aria2-install.sh | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ct/aria2.sh b/ct/aria2.sh
index ee44d8f1..0e6662c4 100644
--- a/ct/aria2.sh
+++ b/ct/aria2.sh
@@ -20,7 +20,7 @@ EOF
 header_info
 echo -e "Loading..."
 APP="Aria2"
-var_disk="6"
+var_disk="8"
 var_cpu="2"
 var_ram="1028"
 var_os="debian"
@@ -68,5 +68,7 @@ build_container
 description
 
 msg_ok "Completed Successfully!\n"
-echo -e "${APP} maintenance page should be reachable by going to the following URL.
-         ${BL}http://${IP}:6800 \n"
+echo -e "${APP} should be accessible via the following IP.
+         ${BL}http://${IP}:6800${CL}"
+echo -e "AriaNG should be reachable by going to the following URL.
+         ${BL}http://${IP}:6880${CL} \n"
diff --git a/install/aria2-install.sh b/install/aria2-install.sh
index 3334e3f7..6d06ffc8 100644
--- a/install/aria2-install.sh
+++ b/install/aria2-install.sh
@@ -32,8 +32,7 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
   cd /root
   mkdir -p /var/www
   wget -q "$(curl -s https://api.github.com/repos/mayswind/ariang/releases/latest | grep download | grep AllInOne.zip | cut -d\" -f4)" -O /root/ariang.zip
-  unzip "$(ls -l /root | grep zip$ | awk '{print $9}')" -d /var/www
-  service_path="/etc/systemd/system/ariang.service"
+  $STD unzip "$(ls -l /root | grep zip$ | awk '{print $9}')" -d /var/www
 cat <<EOF >/etc/nginx/conf.d/ariang.conf
 server {
     listen 6880 default_server;
@@ -50,7 +49,9 @@ server {
 }
 EOF
   rm /etc/nginx/sites-enabled/*
-  systemctl restart nginx
+  $STD systemctl disable --now nginx
+  $STD cp /lib/systemd/system/nginx.service /lib/systemd/system/ariang.service
+  $STD systemctl enable --now ariang
   msg_ok "Installed AriaNG"
 fi