#!/bin/bash logit(){ logthis "ipfs-check: $1" } ipfs files ls /zarchive > /dev/null if [ $? != 0 ] then logit "/zarchive is missing" else logit "/zarchive OK" fi ipfs files ls /zlatest > /dev/null if [ $? != 0 ] then logit "/zlatest is missing" else logit "/zlatest is OK" fi ipfs key list | grep zchain > /dev/null if [ $? != 0 ]; then logit "zchain key is missing" ipfs key gen zchain > $ZCHAIN if [ $? != 0 ]; then logit "zchain fails to create" else logit "zchain created" fi else logit "zchain is there" fi ipfs key list | grep ak-config > /dev/null if [ $? != 0 ]; then logit "ak-config key is missing" ipfs key gen ak-config if [ $? != 0 ]; then logit "ak-config fails to create" else logit "ak-config created" fi else logit "ak-config is there" fi