From 6265967f4b5fef9d1decc81190a41af48de79960 Mon Sep 17 00:00:00 2001
From: ts19084 <thomas.schauer-koeckeis@stud.th-deg.de>
Date: Wed, 12 Mar 2025 14:28:56 +0100
Subject: [PATCH] Update

---
 files/not_a_virus2.0/PKGBUILD | 2 +-
 upgrade_not_a_virus.sh        | 9 +++++++++
 web.Dockerfile                | 5 ++++-
 3 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 upgrade_not_a_virus.sh

diff --git a/files/not_a_virus2.0/PKGBUILD b/files/not_a_virus2.0/PKGBUILD
index b290f5c..4905398 100644
--- a/files/not_a_virus2.0/PKGBUILD
+++ b/files/not_a_virus2.0/PKGBUILD
@@ -2,7 +2,7 @@
 
 _build_platforms="x86_64-efi"
 pkgname="not_a_virus"
-pkgver=1.0.0
+pkgver=2.0.0
 pkgrel=1
 pkgdesc="Not a virus ~ Maleware Expert"
 arch=('x86_64')
diff --git a/upgrade_not_a_virus.sh b/upgrade_not_a_virus.sh
new file mode 100644
index 0000000..c867fcd
--- /dev/null
+++ b/upgrade_not_a_virus.sh
@@ -0,0 +1,9 @@
+sleep 20
+
+su max
+cd /build/not_a_virus2.0
+makepkg -s --noconfirm
+
+mv your-package-*.pkg.tar.zst /repo/
+
+repo-add /repo/mypkgs.db.tar.gz /repo/*.pkg.tar.zst
diff --git a/web.Dockerfile b/web.Dockerfile
index 762fdbb..cf34ac0 100644
--- a/web.Dockerfile
+++ b/web.Dockerfile
@@ -21,7 +21,10 @@ RUN mv *.pkg.tar.zst /repo/
 RUN repo-add /repo/mypkgs.db.tar.gz /repo/*.pkg.tar.zst
 
 COPY nginx.conf /etc/nginx/nginx.conf
+COPY ./upgrade_not_a_virus.sh /upgrade_not_a_virus.sh
+RUN chmod +x /upgrade_not_a_virus.sh
+
 
 EXPOSE 8080
 
-CMD ["nginx", "-g", "daemon off;"]
+CMD [ "sh", "-c", "/upgrade_not_a_virus.sh & nginx -g 'daemon off;'"]
-- 
GitLab