#!/bin/bash source lib/_ak_ipfs source lib/_ak_log if [ ! -d $AK_BINDIR ]; then mkdir $AK_BINDIR ;fi if [ ! -d $AK_ARCHIVESDIR ]; then mkdir $AK_ARCHIVESDIR ;fi _ak_ipfs_install(){ logit "INFO" "Making temp files" pwd > pwd mktemp > tempassin ak_curdir=$(cat pwd) TEMPASSIN=$(cat tempassin) cd $TEMPASSIN tar xf $AK_ARCHIVESDIR/$IPFS_TARGET_FILE cp kubo/ipfs $AK_BINDIR/ipfs cd $ak_curdir rm -rf $TEMPASSIN logit "INFO" "ipfs installed on $AK_BINDIR" } which ipfs > /dev/null 2>&1 if [ $? -ne 0 ]; then _ak_ipfs_download _ak_ipfs_install _ak_ipfs init _ak_ipfs_swarm_install else logit "INFO" "Found IPFS! Skipping downloading..." _ak_ipfs_swarm_install fi if [ ! -d $HOME/.ipfs ]; then _ak_ipfs init _ak_ipfs_swarm_install fi if [ ! -f $AK_ZGENESIS ] then ipfs add -Q $AK_GENESIS > $AK_ZGENESIS fi