From 0ced069a14076f148f240c38f71dd1dc41ae02a2 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 5 Apr 2024 14:32:30 +0300 Subject: using library instead of naked calls --- init.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'init.sh') diff --git a/init.sh b/init.sh index c4c92c0..8de34ce 100755 --- a/init.sh +++ b/init.sh @@ -1,4 +1,5 @@ #!/bin/bash +source lib/_ak_ipfs # TODO GPG/PGP setup:: possibly done # eg gpg2 --full-key-generate and/or gpg2 --set-default key @@ -16,9 +17,9 @@ ak_gpg_check_or_create(){ ipfs_zarchive_check_or_mkdir(){ printf "Checking for /zarchive in IPFS FS..." - ipfs files ls /zarchive > /dev/null 2>&1 + _ak_ipfs files ls /zarchive > /dev/null 2>&1 if [ $? != 0 ]; then - ipfs files mkdir /zarchive > /dev/null 2>&1 + _ak_ipfs files mkdir /zarchive > /dev/null 2>&1 if [ $? != 0 ]; then printf "\tError!\n" exit 1 @@ -32,9 +33,9 @@ ipfs_zarchive_check_or_mkdir(){ ipfs_zlatest_check_or_create(){ printf "Looking for /zlatest..." - ipfs files stat /zlatest > /dev/null 2>&1 + _ak_ipfs files stat /zlatest > /dev/null 2>&1 if [ $? != 0 ]; then - ipfs files cp /ipfs/$(cat $AK_ZGENESIS) /zlatest + _ak_ipfs files cp /ipfs/$(cat $AK_ZGENESIS) /zlatest if [ $? != 0 ]; then printf "\tProblem copying %s to /zlatest!\n" "$AK_ZGENESIS" exit 1 @@ -53,7 +54,7 @@ ak_gpg_check_or_create if [ -f $AK_ZGENESIS ] ; then printf "%s" "$(ipfs add -q $AK_GENESIS)" > $AK_ZGENESIS;fi if [ ! -f $AK_ZCHAIN ] then - ipfs key list | grep zchain + _ak_ipfs key list | grep zchain if [ "$?" -ne 0 ] then printf "%s" "$(ipfs key gen zchain)" > $AK_ZCHAIN -- cgit v1.2.3