diff options
-rwxr-xr-x | bin/akconfig | 9 |
1 files changed, 8 insertions, 1 deletions
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 [ <show> | <publish> ]" + echo "Usage: $PROGRAM [ <show> | <publish> ]" 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 } |