Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[SCRIPT] Generate SHA256SUM files for the mirror



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
#!/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


Messages sorted by: Reverse Date, Date, Thread, Author