From 3d3d79a57fb6d0a5728e0070475f05d1699f0818 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Wed, 16 Mar 2022 23:37:09 -0500 Subject: move a lot of scripts around and make a bunch of minor changes. once again i am too lazy to document the changes properly since im never going to read these commit messages anyways --- misc/verify | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'misc/verify') diff --git a/misc/verify b/misc/verify index 0d17085..5f0430c 100755 --- a/misc/verify +++ b/misc/verify @@ -3,19 +3,21 @@ NORM="\033[0m" CYN="\033[0;36m" GRN="\033[0;32m" RED="\033[0;31m" + printhelp() { -echo "\ +cat << HELPDOC Usage: $(basename "$0") [options] [file/directory]... OPTIONS: -m, --md5 Create/verify md5 checksum - -s[alg], --sha[alg] Create/verify sha checksum - -x[alg], --xxh[alg] Create/verify xxh checksum - -c [alg], --crypt [alg] Create/verify [alg] checksum (uses [alg]sum) + -s[mode], --sha[mode] Create/verify sha[mode] checksum + -x[mode], --xxh[mode] Create/verify xxh[mode] checksum (default) + -c [alg], --crypt [alg] Create/verify [alg] checksum (uses [alg]sum program; e.g. '-c sha256' uses sha256sum) -v, --verify Verify files with existing checksums - -h, --help Print help \ -"; + -h, --help Print help +HELPDOC } + crypt=xxh while true; do case "$1" in @@ -30,7 +32,7 @@ while true; do esac shift done -hashalg=${crypt}sum # Works for current algs +hashalg=${crypt}sum command -v $hashalg >/dev/null || (echo "Hashing algorithm '$hashalg' does not exist!" && exit 2) while [ -n "$1" ]; do -- cgit v1.2.3