-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchksum
executable file
·73 lines (57 loc) · 1.38 KB
/
chksum
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
show_help() {
cat <<EOF
$EXEC_NAME version $VERSION
Usage:
$EXEC_NAME
$EXEC_NAME (-h|--help)
$EXEC_NAME (-v|--version)
Updates the checksums stored in the iRODS catalog.
This script updates the checksum values stored in the iRODS catalog for a set of
data objects. Each replica of each data object is updated. It reads the list of
data objects from stdin with each data object being on its own line.
Options:
-h, --help show help and exit
-v, --version show version and exit
Prerequisites:
1) iRODS iCommands version 4.2.8+ must be installed.
2) The user must be initialized with iRODS as an admin user.
© 2024, The Arizona Board of Regents on behalf of The University of Arizona. For
license information, see https://cyverse.org/license.
EOF
}
set -o errexit -o nounset -o pipefail
readonly VERSION=1
EXEC_NAME="$(basename "$(realpath --canonicalize-missing "$0")")"
readonly EXEC_NAME
main() {
local opts
if ! opts="$(getopt --name="$EXEC_NAME" --options=hv --longoptions=help,version -- "$@")"; then
printf '\n' >&2
show_help >&2
return 1
fi
eval set -- "$opts"
while true; do
case "$1" in
-h|--help)
show_help
return 0
;;
-v|--version)
printf '%s\n' "$VERSION"
return 0
;;
--)
shift
break
;;
*)
show_help >&2
return 1
;;
esac
done
xargs --delimiter='\n' ichksum -a -f -M -v
}
main "$@"