From db531cd69de3b25e047220669c66ccfe82cd052c Mon Sep 17 00:00:00 2001 From: fithwum Date: Fri, 10 Nov 2023 15:27:54 -0800 Subject: [PATCH] updates to version handleing --- alpine/Dockerfile | 2 +- alpine/files/Install_Script.sh | 4 +--- basic/Dockerfile | 1 + basic/files/Install_Script.sh | 4 +--- debian/Dockerfile | 1 + debian/files/Install_Script.sh | 4 +--- testing/test.sh | 12 ++++++++++++ 7 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 testing/test.sh diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 085b093..25f9e02 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer "fithwum" ARG INSTALL_SCRIPT=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/main/alpine/files/Install_Script.sh # Install dependencies and folder creation -RUN apk update && apk add --no-cache ca-certificates libstdc++ su-exec bash-completion tar \ +RUN apk update && apk add --no-cache ca-certificates libstdc++ su-exec bash-completion tar curl jq \ && mkdir -p /ts3server /ts3temp /ts3temp/inifiles /ts3temp/serverfiles \ && chmod 777 -R /ts3server /ts3temp \ && chown 99:100 -R /ts3server /ts3temp diff --git a/alpine/files/Install_Script.sh b/alpine/files/Install_Script.sh index bbe64c0..8c24942 100644 --- a/alpine/files/Install_Script.sh +++ b/alpine/files/Install_Script.sh @@ -6,9 +6,7 @@ TS_FILES=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/main/files echo " " echo "Checking for new server version from Teamspeak." -wget --no-cache https://www.teamspeak.com/versions/server.json -O /ts3temp/server.json -TS_VERSION_CHECK=$(cat /ts3temp/server.json | grep version | head -1 | awk -F: '{print $4}' | sed 's/[",]//g' | sed "s/checksum//g") -TS_VERSION=${TS_VERSION_CHECK} +TS_VERSION=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq --raw-output '.linux.x86.version') CHANGELOG=/ts3server/CHANGELOG_${TS_VERSION} echo "Latest server version from Teamspeak:$TS_VERSION" diff --git a/basic/Dockerfile b/basic/Dockerfile index 6c79f28..7d2b057 100644 --- a/basic/Dockerfile +++ b/basic/Dockerfile @@ -6,6 +6,7 @@ ARG INSTALL_SCRIPT=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/ma # Install dependencies and folder creation RUN apt-get -y update && apt-get clean \ + && apt-get install -y ca-certificates curl jq \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /ts3server /ts3temp /ts3temp/inifiles /ts3temp/serverfiles \ && chmod 777 -R /ts3server /ts3temp \ diff --git a/basic/files/Install_Script.sh b/basic/files/Install_Script.sh index 2c7653e..d21a872 100644 --- a/basic/files/Install_Script.sh +++ b/basic/files/Install_Script.sh @@ -6,9 +6,7 @@ TS_FILES=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/main/files echo " " echo "Checking server version from Teamspeak." -wget --no-cache https://www.teamspeak.com/versions/server.json -O /ts3temp/server.json -TS_VERSION_CHECK=$(cat /ts3temp/server.json | grep version | head -1 | awk -F: '{print $4}' | sed 's/[",]//g' | sed "s/checksum//g") -TS_VERSION=${TS_VERSION_CHECK} +TS_VERSION=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq --raw-output '.linux.x86.version') CHANGELOG=/ts3server/CHANGELOG_${TS_VERSION} echo "Latest server version from Teamspeak:$TS_VERSION" diff --git a/debian/Dockerfile b/debian/Dockerfile index 1844807..a09a5cb 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -6,6 +6,7 @@ ARG INSTALL_SCRIPT=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/ma # Install dependencies and folder creation RUN apt-get -y update && apt-get clean \ + && apt-get install -y ca-certificates curl jq \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /ts3server /ts3temp /ts3temp/inifiles /ts3temp/serverfiles \ && chmod 777 -R /ts3server /ts3temp \ diff --git a/debian/files/Install_Script.sh b/debian/files/Install_Script.sh index 59562df..51a94c5 100644 --- a/debian/files/Install_Script.sh +++ b/debian/files/Install_Script.sh @@ -6,9 +6,7 @@ TS_FILES=https://gitlab.fithwum.tech/fithwum/teamspeak-server/-/raw/main/files echo " " echo "Checking server version from Teamspeak." -wget --no-cache https://www.teamspeak.com/versions/server.json -O /ts3temp/server.json -TS_VERSION_CHECK=$(cat /ts3temp/server.json | grep version | head -1 | awk -F: '{print $4}' | sed 's/[",]//g' | sed "s/checksum//g") -TS_VERSION=${TS_VERSION_CHECK} +TS_VERSION=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq --raw-output '.linux.x86.version') CHANGELOG=/ts3server/CHANGELOG_${TS_VERSION} echo "Latest server version from Teamspeak:$TS_VERSION" diff --git a/testing/test.sh b/testing/test.sh new file mode 100755 index 0000000..faca67a --- /dev/null +++ b/testing/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 2023 fithwum +# All rights reserved + +#MC_VERSION="1.14.4" + +#VERSION_CHECK=$(curl -s "https://www.teamspeak.com/versions/server.json" | grep -Pom 1 '"version": "\K[^"]*') +MC_SERVER_FILE=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq --raw-output '.linux.x86.version') + +echo "Server url: $MC_SERVER_FILE" + +#wget --no-cache ${MC_SERVER_FILE} -O /mnt/Other/Dockers/minecraft/testing/server-${MC_VERSION}.jar \ No newline at end of file