From: xf0r3m Date: Sun, 31 Dec 2023 19:01:57 +0000 (+0100) Subject: Dostosowanie narzędzia immudex-upgrade oraz funkcji library.sh/check_distro_commit... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=f6c101da89e832c1907e728af658b8c244b5ef85;p=immudex.git Dostosowanie narzędzia immudex-upgrade oraz funkcji library.sh/check_distro_commit oraz get_debian_branch dla unifikacji --- 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;