From d643dfcd3548fc9c0fbb01bee3a88984000ecea6 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 11 Feb 2022 09:29:51 +0200 Subject: Added some debug messages --- bin/ak-files | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/ak-files b/bin/ak-files index c307640..7755c58 100755 --- a/bin/ak-files +++ b/bin/ak-files @@ -41,12 +41,33 @@ main(){ FILENAME="$1" CRP="$2" echo "Adding $FILENAME" + logthis "Switching to tmp folder..." TEMPASSIN="$(tempassin)" cd $TEMPASSIN + if [ $? == 0 ]; then + logthis "Success" + else + logthis "Error with tmp folder" + exit 5 + fi + logthis "Copying $1 to $TEMPASSIN" cp $2/$1 $TEMPASSIN/$1 + if [ $? == 0 ]; then + logthis "Copied successfully" + else + logthis "Error copying..." + fi + FILE="$TEMPASSIN/$1" - FILE_IPFS_HASH=$(ipfs add -q $FILE) + logthis "Adding $FILE to IPFS..." + FILE_IPFS_HASH=$(ipfs add -q $FILE) + if [ $? == 0 ]; then + logthis "done" + else + logthis "error" + fi + logthis "Signing..." SIGN_FILE=$FILE".asc" gpg2 --detach-sign --sign-with $FINGERPRINT --armor --output $SIGN_FILE $FILE -- cgit v1.2.3