From 31881d97359a9ca48a74c7f921529cbcf7967d18 Mon Sep 17 00:00:00 2001 From: Archimax <64978924+EnterTheVoid-x86@users.noreply.github.com> Date: Sat, 25 Jan 2025 19:20:07 -0500 Subject: [PATCH 1/2] stop get_original_data.sh from copying the entirety of the root drive --- get_original_data.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/get_original_data.sh b/get_original_data.sh index 3f2bc85..16514b6 100755 --- a/get_original_data.sh +++ b/get_original_data.sh @@ -10,6 +10,10 @@ then fi # Search directory for versions HIGHESTVERSIONAPPARENTLY=$(find "$HOME/.config/$CHROME/PKIMetadata/" -maxdepth 1 -mindepth 1 -type d| head -n 1) +if [ -z ${HIGHESTVERSIONAPPARENTLY} ]; then + echo "Failed to find PKIMetadata directory" + exit 1 +fi #Let the user know what version we are on echo "$HIGHESTVERSIONAPPARENTLY" @@ -18,7 +22,12 @@ echo "$HIGHESTVERSIONAPPARENTLY" mkdir -p original/PKIMetadata/2000 #Copy latest version as base (idk if this is reliable) -cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. original/PKIMetadata/2000 +if [ "$HIGHESTVERSIONAPPARENTLY" != "" ]; then + cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. original/PKIMetadata/2000 +else + echo "Variable HIGHESTVERSIONAPPARENTLY returned empty, failing." + exit 1 +fi #Remove metadata and fingerprint(just sha256 of manifest) to be accepted rm -rvf original/PKIMetadata/2000/_metadata From 10891fb06fe15f913eb2d7b021be922209bdbb80 Mon Sep 17 00:00:00 2001 From: Archimax <64978924+EnterTheVoid-x86@users.noreply.github.com> Date: Sat, 25 Jan 2025 19:20:54 -0500 Subject: [PATCH 2/2] Update get_original_data.sh --- get_original_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_original_data.sh b/get_original_data.sh index 16514b6..92427a1 100755 --- a/get_original_data.sh +++ b/get_original_data.sh @@ -23,7 +23,7 @@ mkdir -p original/PKIMetadata/2000 #Copy latest version as base (idk if this is reliable) if [ "$HIGHESTVERSIONAPPARENTLY" != "" ]; then - cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. original/PKIMetadata/2000 + cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. original/PKIMetadata/2000 else echo "Variable HIGHESTVERSIONAPPARENTLY returned empty, failing." exit 1