-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
58 lines (52 loc) · 1.35 KB
/
install.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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Check for root privileges
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root, as it will move the binary to /usr/local/bin" 1>&2
exit 1
fi
# Detect system architecture
os=$(uname -s)
arch=$(uname -m)
case "$os" in
Linux)
case "$arch" in
armv7*)
target="armv7-unknown-linux-gnueabihf"
;;
aarch64 | aarch64_be | armv8b | armv8l)
target="aarch64-unknown-linux-gnu"
;;
i686 | x86_64)
target="x86_64-unknown-linux-gnu"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
Darwin)
case "$arch" in
arm64)
target="aarch64-apple-darwin"
;;
x86_64)
target="x86_64-apple-darwin"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
*)
echo "Unsupported operating system: $os"
exit 1
;;
esac
# Download and install Swerve
curl -L https://github.com/SpikeHD/swerve/releases/latest/download/swerve-$target -o swerve
chmod +x swerve
# Move to local bin folder
mkdir -p /usr/local/bin
mv swerve /usr/local/bin