소스 검색

bootstrap node addition: fix failure when api not running

Fabian Peter Hammerle 5 년 전
부모
커밋
e925fa7efe
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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 "$@")