From 347e75c7b74ed95f967f0f51a08b49c98eeaa9d6 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Mon, 31 Jan 2022 16:32:37 +0200 Subject: show and publish implementation --- bin/akconfig | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/bin/akconfig b/bin/akconfig index 31e2c9d..bb1cfaf 100755 --- a/bin/akconfig +++ b/bin/akconfig @@ -3,14 +3,31 @@ title(){ echo "Arching Kaos Configuration Tool" } usage(){ - #title + title + exit 0 +} + +show(){ echo ' { "profile":'$(profile index | json_pp)', "genesis":"'$(cat $HOME/.arching-kaos/config/zgenesis)'", "zchain":"'$(cat $HOME/.arching-kaos/config/zchain)'" }'; - exit 0 } -usage +publish(){ + show | json_pp > tmpfile + ipfs name publish --key=ak-config /ipfs/$(ipfs add -q tmpfile) + rm tmpfile +} + +if [ ! -z $1 ]; then + case $1 in + show) show;exit;; + publish) publish;exit;; + *) usage;exit;; + esac +else + usage +fi -- cgit v1.2.3