[SCRIPT] Generate SHA256SUM files for the mirror

Clinton Bunch <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
The browser gods have gotten very aggressive with the red badge of death 
lately and from what I understand find MD5SUM files by themselves 
suspicious as they do software mirrors in general. They don't seem to 
care how many innocent people they take out unless you have lawyers to 
sue them.  So any way with a little AI help I whipped this up. (And yes 
I tested it)  Personally, I think we should add SHA256SUM files sooner 
rather than later.  I was about to set up a mirror and still may but I 
have gotten worried about my domains being blacklisted because I'm 
accused of hosting malware.


#!/bin/zsh
#
setopt EXTENDED_GLOB

for d in **/(/) .; do
   (
     cd "$d" || exit

     files=( *~*(MD5SUM|SHA256SUM)(.N) )

     # Only run if there are actual files to checksum
     if (( ${#files} )); then
       sha256sum "${files[@]}" | sort -k 2 > SHA256SUM
       echo "Generated SHA256SUM in $d"
       md5sum "${files[@]}" | sort -k 2 > MD5SUM
       echo "Generated MD5SUM in $d"
     fi
   )
done
gen-chksum.zsh.txt (text/plain, 406 B)
#!/bin/zsh
#
setopt EXTENDED_GLOB

for d in **/(/) .; do
  (
    cd "$d" || exit
    
    files=( *~*(MD5SUM|SHA256SUM)(.N) )
    
    # Only run if there are actual files to checksum
    if (( ${#files} )); then
      sha256sum "${files[@]}" | sort -k 2 > SHA256SUM
      echo "Generated SHA256SUM in $d"
      md5sum "${files[@]}" | sort -k 2 > MD5SUM
      echo "Generated MD5SUM in $d"
    fi
  )
done
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.