#!/usr/bin/env bash

set -e

if [[ ("$@" != "ipwb") && ("$@" != *" -h"*) && ("$@" != *" --help"*) ]]
then
    # Run the IPFS daemon in background, initialize configs if necessary
    ipfs daemon --init &

    # Wait for IPFS daemon to be ready
    while ! curl -s localhost:5001 > /dev/null
    do
        sleep 1
    done
fi

exec "$@"

#!/usr/bin/env bash

set -e

if [[ ("$@" != "ipwb") && ("$@" != *" -h"*) && ("$@" != *" --help"*) ]]
then
    # Run the IPFS daemon in background, initialize configs if necessary
    ipfs daemon --init --migrate &

    # Wait for IPFS daemon to be ready
    while ! curl -s localhost:5001 > /dev/null
    do
        sleep 1
    done
fi

exec "$@"

Migrate IPFS store automatically when needed
Migrate IPFS store automatically when needed
