1 Star 1 Fork 0

刘煜/xiaozhi-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
active.sh 744 Bytes
一键复制 编辑 原始数据 按行查看 历史
刘煜 提交于 2025-04-17 00:24 +08:00 . 处理多个网卡
#!/bin/bash
# 获取激活码绑定设备
# 安装依赖软件包
# sudo apt install uuid curl jq
API_URL="https://api.tenclass.net/xiaozhi/ota/"
MACADDR=$(ip link show | awk '/link\/ether/ {print $2;exit}')
JSON_DATA=$(cat <<EOF
{
"uuid":"$(uuid)",
"application": {
"name": "xiaozhi_linux",
"version": "1.0.0"
},
"ota": {
},
"board": {
"type": "hqyj_linux_board",
"name": "fs4412"
}
}
EOF
)
CODE=$(curl -s -X POST \
-H "Content-Type: application/json" \
-H "Device-Id: $MACADDR" \
-H "Accept-Language: zh-CN" \
-d "$JSON_DATA" \
"$API_URL" | jq -r '.activation.code'
)
if [ "$CODE" != "null" ]; then
echo "激活码: $CODE"
else
echo "已激活"
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tinytaro/xiaozhi-client.git
git@gitee.com:tinytaro/xiaozhi-client.git
tinytaro
xiaozhi-client
xiaozhi-client
master

搜索帮助