aboutsummaryrefslogtreecommitdiff
path: root/bin/akconfig
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2022-01-31 16:32:37 +0200
committerkaotisk <kaotisk@arching-kaos.com>2022-01-31 16:32:37 +0200
commit347e75c7b74ed95f967f0f51a08b49c98eeaa9d6 (patch)
tree4e96b9df579b22e0793c96390789abedac3c6fd4 /bin/akconfig
parentf768939b36dd377bde182805bda24e9646620625 (diff)
downloadarching-kaos-tools-347e75c7b74ed95f967f0f51a08b49c98eeaa9d6.tar.gz
arching-kaos-tools-347e75c7b74ed95f967f0f51a08b49c98eeaa9d6.tar.bz2
arching-kaos-tools-347e75c7b74ed95f967f0f51a08b49c98eeaa9d6.zip
show and publish implementation
Diffstat (limited to 'bin/akconfig')
-rwxr-xr-xbin/akconfig23
1 files 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