From f6c101da89e832c1907e728af658b8c244b5ef85 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Sun, 31 Dec 2023 20:01:57 +0100 Subject: [PATCH] =?utf8?q?Dostosowanie=20narz=C4=99dzia=20immudex-upgrade?= =?utf8?q?=20oraz=20funkcji=20library.sh/check=5Fdistro=5Fcommit=20oraz=20?= =?utf8?q?get=5Fdebian=5Fbranch=20dla=20unifikacji?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/immudex-upgrade | 8 ++++---- tools/library.sh | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/immudex-upgrade b/tools/immudex-upgrade index 04138df..6deb3f5 100755 --- a/tools/immudex-upgrade +++ b/tools/immudex-upgrade @@ -58,12 +58,12 @@ if [ "$1" ]; then echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; fi elif [ "$1" ] && [ "$1" = "--myversion" ]; then - if [ -d /tmp/immudex-testing ]; then - (cd /tmp/immudex-testing && git pull > /dev/null 2>&1) + if [ -d /tmp/immudex ]; then + (cd /tmp/immudex && git pull > /dev/null 2>&1) else - git clone https://github.com/xf0r3m/immudex-testing /tmp; + git clone https://github.com/xf0r3m/immudex /tmp; fi - (cd /tmp/immudex-testing && git show $(cat /run/live/medium/live/version)) + (cd /tmp/immudex && git show $(cat /run/live/medium/live/version)) else help; exit 1; diff --git a/tools/library.sh b/tools/library.sh index b06fb76..2e50210 100755 --- a/tools/library.sh +++ b/tools/library.sh @@ -3,8 +3,10 @@ function get_debian_branch() { if grep -q 'trixie' /etc/os-release; then echo "testing"; - else + elif grep -q 'bookworm' /etc/os-release; then echo "stable"; + else + echo "oldstable"; fi } @@ -21,14 +23,14 @@ function check_distro_commit() { versionFile="/run/live/medium/live/version"; if [ -f $versionFile ]; then localVersion=$(cat $versionFile); - if [ -d /tmp/immudex-testing ]; then - $(cd /tmp/immudex-testing && git pull -q); + if [ -d /tmp/immudex ]; then + $(cd /tmp/immudex && git pull -q); else - git clone -q https://github.com/xf0r3m/immudex-testing /tmp/immudex-testing; + git clone -q https://github.com/xf0r3m/immudex /tmp/immudex; fi - latestVersion=$(cd /tmp/immudex-testing && git log --pretty=oneline | head -1 | cut -d " " -f 1); + latestVersion=$(cd /tmp/immudex && git log --pretty=oneline | head -1 | cut -d " " -f 1); if [ "$1" ] && [ "$1" == "--print" ]; then - echo "$(cd /tmp/immudex-testing && git log ${localVersion}..${latestVersion})"; + echo "$(cd /tmp/immudex && git log ${localVersion}..${latestVersion})"; fi if [ "$localVersion" = "$latestVersion" ]; then return 0; -- 2.39.5