#!/bin/bash PROGRAM="$(basename $0)" source lib/_ak_script source lib/_ak_log source lib/_ak_ipfs if [ ! -d $AK_BINDIR ]; then mkdir $AK_BINDIR ;fi if [ ! -d $AK_ARCHIVESDIR ]; then mkdir $AK_ARCHIVESDIR ;fi _ak_ipfs_install(){ _ak_log_info "Making temp files" pwd > pwd mktemp -d > 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 _ak_log_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 _ak_log_info "Found IPFS! Skipping downloading..." _ak_ipfs_swarm_install fi if [ ! -d $AK_IPFS_REPO ] then _ak_ipfs init _ak_ipfs_swarm_install fi if [ ! -f $AK_ZGENESIS ] then ipfs add -Q $AK_GENESIS > $AK_ZGENESIS fi