-
Notifications
You must be signed in to change notification settings - Fork 14
/
install.sh
executable file
·49 lines (43 loc) · 1.15 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
#!/bin/bash
# 获取系统类型
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
# 获取 CPU 架构
ARCH=$(uname -m)
if [ -z "$1" ]; then
VERSION="v1.1.2"
else
VERSION="$1"
fi
# 根据系统类型和 CPU 架构选择不同的 curl 下载地址
if [[ "$OS" == "linux" ]]; then
if [[ "$ARCH" == "amd64" ]]; then
REALARCH="amd64"
elif [[ "$ARCH" == "arm64" ]]; then
REALARCH="arm64"
elif [[ "$ARCH" == "x86_64" ]]; then
REALARCH="amd64"
elif [[ "$ARCH" == "aarch64" ]]; then
REALARCH="arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
elif [[ "$OS" == "darwin" ]]; then
if [[ "$ARCH" == "amd64" ]]; then
REALARCH="amd64"
elif [[ "$ARCH" == "arm64" ]]; then
REALARCH="arm64"
elif [[ "$ARCH" == "x86_64" ]]; then
REALARCH="amd64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
else
echo "Unsupported operating system: $OS"
exit 1
fi
echo "dolowadning wukongimcli for $OS/$REALARCH ..."
# 下载 curl
curl -L "https://gitee.com/WuKongDev/WuKongIMCli/releases/download/$VERSION/wukongimcli-$OS-$REALARCH" -o /usr/local/bin/wk
chmod +x /usr/local/bin/wk