diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-05-09 04:11:21 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-05-09 04:11:21 +0300 |
commit | b18332a916c233fdcd089bf8a7c7f172fd57a47a (patch) | |
tree | d3d2d84b4fe4b91c225e218f420388afbf6ed6f7 | |
parent | e9dcfb7f9294ccc63ec526f13c56292eee8ecaac (diff) | |
download | arching-kaos-tools-b18332a916c233fdcd089bf8a7c7f172fd57a47a.tar.gz arching-kaos-tools-b18332a916c233fdcd089bf8a7c7f172fd57a47a.tar.bz2 arching-kaos-tools-b18332a916c233fdcd089bf8a7c7f172fd57a47a.zip |
driver for hash tree fs
-rwxr-xr-x | bin/ak-sm-hash-to-path | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/ak-sm-hash-to-path b/bin/ak-sm-hash-to-path new file mode 100755 index 0000000..f08d4d4 --- /dev/null +++ b/bin/ak-sm-hash-to-path @@ -0,0 +1,41 @@ +#!/bin/bash +## +## With this tool you give a SHA512 and take the following: +## +## -h, --help This help message +## +## -d, --dir <base path> <hash> Directory that the hashed file would be +## hosted +## +## -p, --path <base path> <hash> Full path that the hashed file would be +## saved +## + +fullprogrampath="$(realpath $0)" +PROGRAM="$(basename $0)" +descriptionString="Simple driver for hashes/chunks/branches" +source $AK_LIBDIR/_ak_fs +source $AK_LIBDIR/_ak_script + +case "$1" in + -h | --help) + _ak_usage + exit 1 + ;; + -d | --dir) + _ak_verify_input_is_hash $2 + _ak_return_hash_dir $2 + exit 0 + ;; + -p | --path) + _ak_verify_input_is_hash $2 + _ak_return_hash_path $2 + exit 0 + ;; + *) + echo "no option?!" >&2 + exit 1 + ;; +esac + +exit 0 |