From 6e5f9fa0f25a284921fe15f0300e9466f0683379 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 13 Oct 2024 00:26:10 +0200 Subject: [PATCH 1/3] feat: Improve CPU detection --- src/reset.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/reset.sh b/src/reset.sh index a8ffd563..36688c60 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -54,12 +54,18 @@ else fi if ! grep -qi "model name" <<< "$CPI"; then - CPU="Unknown" + CPU="" else CPU=$(echo "$CPI" | grep -m 1 -i 'model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g') - CPU="${CPU// with Radeon Graphics/}" fi +if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then + CPU=$(echo "$CPI" | grep -m 1 -i 'model:' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g') +fi + +[ -z "${CPU// /}" ] && CPU="Unknown" +CPU="${CPU// with Radeon Graphics/}" + # Check system if [ ! -d "/dev/shm" ]; then From 17b3eeb6489fac00eee2cf2a7920e1c5994a46a2 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 13 Oct 2024 02:52:08 +0200 Subject: [PATCH 2/3] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 81f79385..62a921f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,8 +40,8 @@ RUN set -eu && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY --chmod=755 ./src /run/ -COPY --chmod=755 ./web /var/www/ -COPY --chmod=744 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf +COPY --chmod=644 ./web /var/www/ +COPY --chmod=644 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf VOLUME /storage EXPOSE 22 5900 8006 From 0d5a1c67821ba669b6d731d0a292aa71d9af0083 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 13 Oct 2024 03:01:45 +0200 Subject: [PATCH 3/3] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62a921f6..81f79385 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,8 +40,8 @@ RUN set -eu && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY --chmod=755 ./src /run/ -COPY --chmod=644 ./web /var/www/ -COPY --chmod=644 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf +COPY --chmod=755 ./web /var/www/ +COPY --chmod=744 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf VOLUME /storage EXPOSE 22 5900 8006