aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-node-info
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-31 12:00:59 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-03-31 12:00:59 +0300
commite4f18be94261b39544ef3bc50321f6aedeb45bd6 (patch)
tree2c79daf0bdc91beb91846f00bb3d3f51236967cf /bin/ak-node-info
parent23a61661f03c03a357ad8aa47ba3595fabe24de1 (diff)
downloadarching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.gz
arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.tar.bz2
arching-kaos-tools-e4f18be94261b39544ef3bc50321f6aedeb45bd6.zip
huge refactor, might breaking things
Diffstat (limited to 'bin/ak-node-info')
-rwxr-xr-xbin/ak-node-info31
1 files changed, 23 insertions, 8 deletions
diff --git a/bin/ak-node-info b/bin/ak-node-info
index 1b12798..b667fd3 100755
--- a/bin/ak-node-info
+++ b/bin/ak-node-info
@@ -1,5 +1,20 @@
#!/bin/bash
-PROGRAM="$(basename $0)"
+##
+## Brief description
+##
+## Usage:
+##
+## -h, --help Prints this help message
+##
+## --ipfs
+##
+## --ipns
+##
+fullprogrampath="$(realpath $0)"
+PROGRAM=$(basename $0)
+descriptionString="Quick description"
+source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_script
source $AK_LIBDIR/_ak_ipfs
# Resolves the IPNS key "ak-config" to its current IPFS value
# Return IPFS CIDv0 without /ipfs/ prefix
@@ -13,23 +28,23 @@ _ak_node_info_ipns_key(){
_ak_ipfs_key_list_full | grep ak-config | awk '{print $1}'
}
-_ak_node_info_usage(){
- echo "$PROGRAM ipfs | ipns"
-}
if [ ! -z "$1" ]
then
case "$1" in
- ipfs)
+ -h|--help)
+ _ak_usage
+ ;;
+ --ipfs)
_ak_node_info_ipfs_hash
;;
- ipns)
+ --ipns)
_ak_node_info_ipns_key
;;
*)
- _ak_node_info_usage
+ _ak_usage
;;
esac
else
- _ak_node_info_usage
+ _ak_usage
fi