aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/.bashrc_distr
blob: 6534378f51d15f4675d95904163e7d158a6739c2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                   



                             
                                     


                          





                                                                             




                                   
#!/usr/bin/env bash

if [ -n "${BASHRC_DISTR+x}" ]; then
  return 0
else
  readonly BASHRC_DISTR=1
fi

checksums_path='sha1sums.txt'

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

update_checksums_distr() {
  local -a paths=()
  local path
  while IFS= read -r -d $'\0' path; do
    paths+=("$path")
  done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 )
  update_checksums "${paths[@]+"${paths[@]}"}"
}

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