aboutsummaryrefslogtreecommitdiff
path: root/bin/akconfig
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2022-12-03 01:38:38 +0200
committerkaotisk <kaotisk@arching-kaos.org>2022-12-03 01:38:38 +0200
commit25a6710b5d206a6edb51d5efeeafc6b0d7e2d9a2 (patch)
treec2066e35d9882ecec3bb8b41492fd74b73dbb374 /bin/akconfig
parent7e08d401a7d9acba7b9e319ca981b78dd8b00556 (diff)
downloadarching-kaos-tools-25a6710b5d206a6edb51d5efeeafc6b0d7e2d9a2.tar.gz
arching-kaos-tools-25a6710b5d206a6edb51d5efeeafc6b0d7e2d9a2.tar.bz2
arching-kaos-tools-25a6710b5d206a6edb51d5efeeafc6b0d7e2d9a2.zip
Adapting to 96ae225b2a179ec36fdb01eaf906fec096002a08 change, also provide a useful message in case of failing pubishing
Diffstat (limited to 'bin/akconfig')
-rwxr-xr-xbin/akconfig9
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
}