diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-03-08 17:35:11 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-03-08 17:35:11 +0200 |
commit | 42daa97e3408e069a767a9e7bfbd8518cf6ec0f4 (patch) | |
tree | 6d48cee8db55f8d10f7790ff2f12d90aff277342 /tidy_history.sh | |
parent | b27943a4f61e09362aa16d40443b1d0d23153404 (diff) | |
download | arching-kaos-tools-master.tar.gz arching-kaos-tools-master.tar.bz2 arching-kaos-tools-master.zip |
Tiny tool to export /zarchive from IPFSHEADorigin/masterorigin/HEADmaster
Diffstat (limited to 'tidy_history.sh')
-rwxr-xr-x | tidy_history.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tidy_history.sh b/tidy_history.sh new file mode 100755 index 0000000..ec346e6 --- /dev/null +++ b/tidy_history.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +source lib/_ak_fm +source lib/_ak_script + +tmp=$(_ak_make_temp_file) + +ipfs files ls -l /zarchive >> $tmp +ak ipfs -r files ls -l /zarchive >> $tmp + +_ak_fm_sort_uniq_file $tmp + +cat $tmp | grep -v '/' | awk '{print $1 " " $2 }' | while read ttt hhh +do + trt="$(echo -n ${ttt} | cut -d '-' -f 1)" + trh="$(echo -n ${ttt} | cut -d '-' -f 2)" + if [ -n "${trh}" ] && [ "${trh}" == "${hhh}" ] + then + echo "${trt} ${hhh}" + else + echo "Hash not exist in filename" >&2 + echo "${trt} ${hhh}" + fi +done > $AK_ZLATEST_HISTORY + +rm $tmp |