From ca4f52ee442921a8879751d708625363d7f14ee8 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Mon, 14 Aug 2023 14:35:20 +0200 Subject: [PATCH] =?utf8?q?Dopisanie=20funkcji=20upgrade-u=20do=20narz?= =?utf8?q?=C4=99dzia=20immudex-upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/immudex-upgrade | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/immudex-upgrade b/tools/immudex-upgrade index ce8d5f6..ba0aba5 100755 --- a/tools/immudex-upgrade +++ b/tools/immudex-upgrade @@ -44,10 +44,31 @@ if [ "$1" ]; then check_distro_commit --print; fi elif [ "$1" ] && [ "$1" = "--upgrade" ]; then - + echo -n "Mounting iso image..."; + sudo mount $2 /mnt > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi + part=$(sudo blkid | grep 'LABEL="immudex"' | awk '{printf $1}' | cut -d ":" -f 1); + mountPointList=$(sudo mount | grep "$part" | awk '{printf $3" "}'); + for mountPoint in $mountPointList; do + echo -n "Unlocking $mountPoint ..."; + sudo mount $part $mountPoint -o remount,rw > /dev/null 2>&1; + if [ $? -eq 0 ]; then + echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; + else + echo -e "[ ${RED}FAIL${ENDCOLOR} ]"; + fi + done + echo "Copying immudex files to the disk..."; + sudo cp -vv /mnt/live/* ${mountPoint}/live; + if [ $? -eq 0 ]; then + echo -e "Copying immudex files to the disk...[ ${GREEN}OK${ENDCOLOR} ]"; + else + echo -e "Copying immudex files to the disk...[ ${RED}FAIL${ENDCOLOR} ]"; + fi else help; exit 1; + fi else help; exit 1; -- 2.39.5