forked from cortensor/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-ipfs-osx.sh
executable file
·47 lines (39 loc) · 1.39 KB
/
install-ipfs-osx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# This script installs IPFS.
# https://github.com/ipfs/kubo/releases/download/v0.29.0/kubo_v0.29.0_linux-arm64.tar.gz
# https://github.com/ipfs/kubo/releases/download/v0.29.0/kubo_v0.29.0_darwin-amd64.tar.gz
# Navigate to the directory where the script resides
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $DIR
echo "Starting IPFS installation process..."
echo "======================================="
echo "1. Downloading IPFS package - Darwin ARM64"
# Download the IPFS package
IPFS_VERSION="v0.29.0"
IPFS_PACKAGE="kubo_${IPFS_VERSION}_darwin-arm64.tar.gz"
IPFS_URL="https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/${IPFS_PACKAGE}"
curl -fsSL $IPFS_URL -o $IPFS_PACKAGE
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to download IPFS package from $IPFS_URL"
exit 1
fi
echo " - IPFS package downloaded successfully"
echo "2. Extracting IPFS package"
# Extract the package
tar xzfv $IPFS_PACKAGE
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to extract $IPFS_PACKAGE"
exit 1
fi
echo " - IPFS package extracted successfully"
echo "3. Installing IPFS"
# Run the installation script
mkdir -p ~/bin
sudo cp -Rfv ./kubo/ipfs ~/bin/
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to install IPFS"
exit 1
fi
echo " - IPFS installed successfully"
echo "======================================="
echo "IPFS installation process completed successfully!"