Browse Source

More work on sha256sum

bryan 2 years ago
parent
commit
4c130e347c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      openwrtbuilder

+ 3 - 3
openwrtbuilder

@@ -388,11 +388,11 @@ verifyImage() {
             debug "Failed to download checksum"
             debug "Failed to download checksum"
         fi
         fi
 
 
-        for file in "$FACTORYIMGGZFNAME" "$SYSUPGRADEIMGGZFNAME"; do
+        for file in "$FACTORYIMGGZ" "$SYSUPGRADEIMGGZ"; do
             [[ -f $file ]] || break
             [[ -f $file ]] || break
-            checksum=$(grep "$file" "$SHA256_FILE" | cut -f1 -d' ')
+            checksum=$(grep "${file##*/}" "$SHA256_FILE" | cut -f1 -d' ')
             debug "checksum: $checksum"
             debug "checksum: $checksum"
-            echo "$checksum $file" | sha256sum --check --status
+            echo -n "$checksum $file" | sha256sum --check --status
             debug "checksum return code: $?"
             debug "checksum return code: $?"
         done
         done
     fi
     fi