File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ while true; do
3232done
3333
3434ui_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."
3638ui_print " "
3739
3840mkdir -p " /data/adb/service.d"
Original file line number Diff line number Diff line change 1+ # Returns: 0 = all ok, 1 = missing hash file, 2 = hash mismatch
12find " $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
You can’t perform that action at this time.
0 commit comments