diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 03:22:23 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 03:22:23 +0300 |
commit | ad7d6281475c4adb67e0a43017803aeb4a9059ce (patch) | |
tree | 8ab67767b59cec7a0882fe22169ed8076806aa93 /bin | |
parent | f923b782d6d1dae8af03ab9f1ef709dd0c4c6b10 (diff) | |
download | arching-kaos-tools-ad7d6281475c4adb67e0a43017803aeb4a9059ce.tar.gz arching-kaos-tools-ad7d6281475c4adb67e0a43017803aeb4a9059ce.tar.bz2 arching-kaos-tools-ad7d6281475c4adb67e0a43017803aeb4a9059ce.zip |
Some cleanup and further working on the tool
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ak-sm-files | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/bin/ak-sm-files b/bin/ak-sm-files index a22c0d7..6aaea26 100755 --- a/bin/ak-sm-files +++ b/bin/ak-sm-files @@ -2,7 +2,7 @@ # The following creates a mixtape data message # We can extend it by calling the ak-pack_z_block.sh mixtape/add data ZFILESDIR="$AK_WORKDIR/files" -TEMP="/tmp/aktmp" + PROGRAM="$(basename $0)" #set -xe logit(){ @@ -111,9 +111,9 @@ main(){ } EOF -echo "Printing data..." -cat $TEMPASSIN/data -echo "Publishing..." + echo "Printing data..." + cat $TEMPASSIN/data + echo "Publishing..." ak-pack_z_block sha-files/announce data if [ $? == 0 ] @@ -125,16 +125,31 @@ echo "Publishing..." fi } - index(){ tail -n1 $AK_WORKDIR/fmp/* | grep '^[abcdef1234567890]' | awk '{ print $2 }' } +ls-mapfiles(){ + cd $AK_WORKDIR/fmp + for f in `find . -type f | sed -e 's/\.\///g'`;do + FILENAME="$(tail -n1 $f | grep '^[abcdef1234567890]' | awk '{ print $2 }')" + FILEHASH="$(tail -n1 $f | grep '^[abcdef1234567890]' | awk '{ print $1 }')" + MAPFILE="$f" + printf "\nMap: %s\nFilename: %s\nSum: %s\n\n" $MAPFILE $FILENAME $FILEHASH + done +} + +full-index(){ + tail -n1 $AK_WORKDIR/fmp/* | grep '^[abcdef1234567890]' +} + if [ ! -z $1 ]; then case $1 in help) usage; exit;; add) add $2; exit;; index) index; exit;; + full-index) full-index; exit;; + ls-map-files) ls-mapfiles; exit;; *) usage; exit;; esac else usage |