aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/.bashrc_distr
blob: ad01f57fe4feddb0c6f1ab8ba7d5337d61594aa4 (plain) (tree)
1
2
3
4
5
6
7
8

                   


                             
                                       

 


                                         
                  
              
 
                                     

                                                                               
 
                                                
 

                    
                                     
 
#!/usr/bin/env bash

checksums_path='sha1sums.txt'

update_checksums() {
    sha1sum -- "$@" > "$checksums_path"
}

update_checksums_distr() (
    set -o errexit -o nounset -o pipefail

    local -a paths
    local path

    while IFS= read -d '' -r path; do
        paths+=("$path")
    done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 )

    update_checksums "${paths[@]+"${paths[@]}"}"
)

verify_checksums() {
    sha1sum --check "$checksums_path"
}