Browse Source

bootstrap node addition: fix failure when api not running

Fabian Peter Hammerle 5 years ago
parent
commit
e925fa7efe
1 changed files with 5 additions and 1 deletions
  1. 5 1
      entrypoint.sh

+ 5 - 1
entrypoint.sh

@@ -15,7 +15,11 @@ if [ "$IPFS_SWARM_ADDRS" != "default" ]; then
 fi
 
 if [ ! -z "$IPFS_BOOTSTRAP_ADD" ]; then
-    (set -x; ipfs bootstrap add -- $IPFS_BOOTSTRAP_ADD)
+    # + ipfs bootstrap add -- /dnsaddr/...
+    # Error: api not running
+    tmp=$(mktemp)
+    (set -x; jq '.Bootstrap |= (. + $ARGS.positional | unique)' --args $IPFS_BOOTSTRAP_ADD <"$IPFS_CONFIG_PATH" >$tmp)
+    mv $tmp "$IPFS_CONFIG_PATH"
 fi
 
 (set -x; exec "$@")