@@ -21,18 +21,17 @@ ipfs-init:
2121 #!/usr/bin/env bash
2222 set -e
2323
24- # Check if IPFS is available
25- if ! command -v ipfs &> / dev/ null; then
26- IPFS_CMD=" ./kubo/ipfs"
27- if [ ! -f " $IPFS_CMD" ]; then
28- echo " ❌ Error: Neither system IPFS nor ./kubo/ipfs found."
29- echo " Please install IPFS or download kubo to ./kubo/"
30- exit 1
31- fi
32- else
24+ if [ -f " ../kubo/ipfs" ]; then
25+ IPFS_CMD=" ../kubo/ipfs"
26+ elif command -v ipfs &> / dev/ null; then
3327 IPFS_CMD=" ipfs"
28+ else
29+ echo " ❌ Error: IPFS not found."
30+ exit 1
3431 fi
3532
33+ echo " 🔧 Using IPFS command: $IPFS_CMD"
34+
3635 # Initialize IPFS if needed
3736 if [ ! -d ~/ .ipfs ]; then
3837 echo " 📦 Initializing IPFS..."
@@ -48,13 +47,16 @@ ipfs-start:
4847
4948 mkdir -p {{ PID_DIR }}
5049
51- # Check if IPFS is available
52- if ! command -v ipfs &> / dev/ null; then
53- IPFS_CMD=" ./kubo/ipfs"
54- else
50+ if [ -f " ../kubo/ipfs" ]; then
51+ IPFS_CMD=" ../kubo/ipfs"
52+ elif command -v ipfs &> / dev/ null; then
5553 IPFS_CMD=" ipfs"
54+ else
55+ echo " ❌ Error: IPFS not found."
56+ exit 1
5657 fi
5758
59+ echo " 🔧 Using IPFS command: $IPFS_CMD"
5860 echo " 📡 Starting IPFS daemon..."
5961 $IPFS_CMD daemon > / tmp/ ipfs-daemon.log 2 >&1 &
6062 IPFS_PID=$!
@@ -68,13 +70,16 @@ ipfs-connect:
6870 #!/usr/bin/env bash
6971 set -e
7072
71- # Check if IPFS is available
72- if ! command -v ipfs &> / dev/ null; then
73- IPFS_CMD=" ./kubo/ipfs"
74- else
73+ if [ -f " ../kubo/ipfs" ]; then
74+ IPFS_CMD=" ../kubo/ipfs"
75+ elif command -v ipfs &> / dev/ null; then
7576 IPFS_CMD=" ipfs"
77+ else
78+ echo " ❌ Error: IPFS not found."
79+ exit 1
7680 fi
7781
82+ echo " 🔧 Using IPFS command: $IPFS_CMD"
7883 echo " 🔗 Connecting IPFS nodes..."
7984 $IPFS_CMD swarm connect / ip4/ 127.0.0.1 / tcp/ 12347 / ws/ p2p/ 12 D3KooWRkZhiRhsqmrQ28 rt73 K7V3aCBpqKrLGSXmZ99 PTcTZby || true
8085 $IPFS_CMD swarm connect / ip4/ 127.0.0.1 / tcp/ 10001 / ws/ p2p/ 12 D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm || true
0 commit comments