Skip to content

Commit b817b0d

Browse files
committed
update installation scripts
1 parent 6369b31 commit b817b0d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

customize.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ while true; do
3232
done
3333

3434
ui_print ""
35-
source "$MODPATH/verify.sh"
35+
sh "$MODPATH/verify.sh"
36+
[ $? -eq 0 ] || abort "! Aborting: file integrity check failed."
37+
ui_print "- All files verified."
3638
ui_print ""
3739

3840
mkdir -p "/data/adb/service.d"

test.zip

53.2 KB
Binary file not shown.

verify.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
# Returns: 0 = all ok, 1 = missing hash file, 2 = hash mismatch
12
find "$MODPATH" -type f | grep -v '\.sha256$' | while read -r file; do
23
name="${file##*/}"
34
hashfile="${file}.sha256"
45

56
ui_print "- Verifying $name..."
67

7-
[ -f "$hashfile" ] || abort "! Missing hash file: ${hashfile##"$MODPATH/"}"
8+
[ -f "$hashfile" ] || { ui_print "! Missing hash: $name.sha256"; exit 1; }
89

910
expected="$(cat "$hashfile" | tr -d '[:space:]')"
1011
actual="$(sha256sum "$file" | cut -d' ' -f1)"
1112

12-
[ "$actual" = "$expected" ] || abort "! Integrity check failed: $name"
13-
done
14-
15-
ui_print "- All files verified."
13+
[ "$actual" = "$expected" ] || { ui_print "! Mismatch: $name"; exit 2; }
14+
done

0 commit comments

Comments
 (0)