|
@@ -1,12 +1,17 @@
|
|
#!/bin/sh
|
|
#!/bin/sh
|
|
|
|
|
|
-if [ ! -e "$IPFS_PATH/config" ]; then
|
|
|
|
|
|
+export IPFS_CONFIG_PATH="$IPFS_PATH/config"
|
|
|
|
+
|
|
|
|
+if [ ! -e "$IPFS_CONFIG_PATH" ]; then
|
|
(set -x; ipfs init --empty-repo --profile $IPFS_INIT_PROFILE)
|
|
(set -x; ipfs init --empty-repo --profile $IPFS_INIT_PROFILE)
|
|
fi
|
|
fi
|
|
|
|
|
|
if [ "$IPFS_SWARM_ADDRS" != "default" ]; then
|
|
if [ "$IPFS_SWARM_ADDRS" != "default" ]; then
|
|
- addrs_json=$(jq --null-input --compact-output '$ARGS.positional' --args $IPFS_SWARM_ADDRS)
|
|
|
|
- (set -x; ipfs config --json Addresses.Swarm "$addrs_json")
|
|
|
|
|
|
+ # + ipfs config --json Addresses.Swarm '["/ip4/0.0.0.0/tcp/4001"]'
|
|
|
|
+ # Error: api not running
|
|
|
|
+ tmp=$(mktemp)
|
|
|
|
+ (set -x; jq '.Addresses.Swarm |= $ARGS.positional' --args $IPFS_SWARM_ADDRS <"$IPFS_CONFIG_PATH" >$tmp)
|
|
|
|
+ mv $tmp "$IPFS_CONFIG_PATH"
|
|
fi
|
|
fi
|
|
|
|
|
|
if [ ! -z "$IPFS_BOOTSTRAP_ADD" ]; then
|
|
if [ ! -z "$IPFS_BOOTSTRAP_ADD" ]; then
|