aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-10-05 22:24:48 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-10-05 22:24:48 +0300
commitaec105078d8a1b64ca75bc3b7cb20c1d2dbbd59d (patch)
tree5ef396f8b27e36890877424b89e657351ae2a95f
parent2a3c61fbf515ce1ee5cb98b0c84c11b4af58ec8a (diff)
downloadarching-kaos-tools-aec105078d8a1b64ca75bc3b7cb20c1d2dbbd59d.tar.gz
arching-kaos-tools-aec105078d8a1b64ca75bc3b7cb20c1d2dbbd59d.tar.bz2
arching-kaos-tools-aec105078d8a1b64ca75bc3b7cb20c1d2dbbd59d.zip
[ak-fs] --llist flag: Long-like list feature. Prints mod date instead of root hash
-rwxr-xr-xbin/ak-fs2
-rwxr-xr-xlib/_ak_fs17
-rwxr-xr-xlib/_ak_ns8
3 files changed, 27 insertions, 0 deletions
diff --git a/bin/ak-fs b/bin/ak-fs
index f95a924..a7a0dca 100755
--- a/bin/ak-fs
+++ b/bin/ak-fs
@@ -27,6 +27,7 @@
## --get, --export <roothash> <output file> Exports a file from the AKFS system
## --cat <roothash> Concatenates from given hash
## --list Lists names and roots available
+## --llist Lists names available and their dates
## --net-cat-from-map <maphash> Concatenates from map via the network
## --net-get-from-map <maphash> Downloads from map via the network
## --cfm <maphash> Concatenates from map
@@ -53,6 +54,7 @@ then
--net-cat-from-map) _ak_fs_net_cat_from_map_hash $2; exit;;
--net-get-from-map) _ak_fs_net_get_from_map_hash $2; exit;;
--list) _ak_fs_list; exit;;
+ --llist) _ak_fs_long_list; exit;;
--cfm) _ak_fs_cat_from_map_hash $2; exit;;
--gfm) _ak_fs_get_from_map_hash $2; exit;;
--rhd) _ak_fs_return_hash_dir $2; echo ;exit;;
diff --git a/lib/_ak_fs b/lib/_ak_fs
index 07929b6..108c682 100755
--- a/lib/_ak_fs
+++ b/lib/_ak_fs
@@ -354,6 +354,23 @@ function _ak_fs_list(){
fi
}
+function _ak_fs_long_list(){
+ if [ -d "${AK_MAPSDIR}" ]
+ then
+ find $AK_MAPSDIR -type f | while read fina
+ do
+ stats="$(stat --format=%y ${fina}|tr -d '\n'|tr ' ' '_')"
+ date_stats="$(echo ${stats}|cut -d '_' -f 1)"
+ time_stats="$(echo ${stats}|cut -d '_' -f 2|cut -d '.' -f 1)"
+ cat $fina | tr '\n' ' ' | awk '{ print "'$(basename ${fina})' " "'$date_stats'" " " "'$time_stats'" " "$2 }'
+ done
+ else
+ _ak_log_debug "Making ${AK_MAPSDIR} directory"
+ mkdir -p ${AK_MAPSDIR}
+ _ak_log_debug "Empty directory"
+ fi
+}
+
function _ak_fs_from_map_get_original_hash(){
if [ ! -z "$1" ] && [ -n "$1" ]
then
diff --git a/lib/_ak_ns b/lib/_ak_ns
index 24c0761..e6e8e65 100755
--- a/lib/_ak_ns
+++ b/lib/_ak_ns
@@ -297,6 +297,9 @@ function _ak_ns_resolve_all_keys(){
fi
done > peer_list
_ak_log_info "Filtering IPs out of locals..."
+ # cat ip_list
+ _ak_log_info "Filtering IPs out from peers..."
+ # cat peer_list
cat ip_list | while read ip
do
sed -i 's/^'$ip'$//g' peer_list
@@ -306,12 +309,17 @@ function _ak_ns_resolve_all_keys(){
_ak_log_error "No IPs to scan from"
exit 1
fi
+ _ak_log_info "Filtered IPs out from peers..."
+ # cat peer_list
cat peer_list | while read ip
do
_ak_log_info "Extracing keys from $ip..."
ak network -p incoming \
| jq --arg ip "$ip" '.[] | select(.incoming.ip == $ip )' \
| jq '.node_info.keymaps.[]'> keymaps_list.$ip
+# ak network -p incoming \
+# | jq --arg ip "$ip" '.[] | select(.incoming.ip == $ip )' \
+# | jq '.node_info.keymaps.[]'
done
cat peer_list | while read ip
do