From 25a6710b5d206a6edb51d5efeeafc6b0d7e2d9a2 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 3 Dec 2022 01:38:38 +0200 Subject: Adapting to 96ae225b2a179ec36fdb01eaf906fec096002a08 change, also provide a useful message in case of failing pubishing --- bin/akconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/akconfig b/bin/akconfig index 821e910..bc06e49 100755 --- a/bin/akconfig +++ b/bin/akconfig @@ -1,4 +1,5 @@ #!/bin/bash +PROGRAM="$(basename $0)" title(){ echo "Arching Kaos Configuration Tool" echo "===============================" @@ -6,7 +7,7 @@ title(){ usage(){ title echo "" - echo "Usage: $0 [ | ]" + echo "Usage: $PROGRAM [ | ]" echo "" echo " show Show current configuration (from FileSystem)" echo " publish Publish current configuration" @@ -28,6 +29,12 @@ show(){ publish(){ show | json_pp > tmpfile ipfs name publish --key=ak-config /ipfs/$(ipfs add -q tmpfile) + if [ "$?" != 0 ] + then + echo -e "\033[0;34mError on publishing\033[0;0m\nYour information:\n" + cat tmpfile + exit 1 + fi rm tmpfile } -- cgit v1.2.3