-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdo.sum.bash
More file actions
executable file
·32 lines (32 loc) · 914 Bytes
/
do.sum.bash
File metadata and controls
executable file
·32 lines (32 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Copyright 2019-2022 (c) all rights reserved by S D Rausty; see LICENSE
# https://sdrausty.github.io hosted courtesy https://pages.github.com
# To create the checksum file and commit use; ./do.sum.bash
# To see the file tree use; awk '{ print $2 }' md5.sum
# To check the files use; md5sum -c md5.sum
#####################################################################
set -eu
git pull
rm -f *.sum
FILELIST=( $(find . -type f | grep -vw .git | sort) )
CHECKLIST=(sha512sum)
for SCHECK in ${CHECKLIST[@]}
do
printf "%s\\n" "Creating $SCHECK file: Please wait a moment..."
for FILE in "${FILELIST[@]}"
do
$SCHECK "$FILE" >> ${SCHECK::-3}.sum
done
chmod 400 ${SCHECK::-3}.sum
done
for SCHECK in ${CHECKLIST[@]}
do
printf "\\n%s\\n" "Checking $SCHECK..."
$SCHECK -c ${SCHECK::-3}.sum
done
git add .
git commit
git push
ls
printf "\\e[1;38;5;112m%s\\e[0m\\n" "$PWD"
# do.sum.bash EOF