From 2d6c17d02f09eb9185a5744dcafefe83eae63aeb Mon Sep 17 00:00:00 2001 From: Del Wang Date: Wed, 10 Dec 2025 18:16:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=AC=E7=BD=91=E7=BB=9C=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/kws/boot.sh | 8 ++++++-- packages/client-rust/boot.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/kws/boot.sh b/examples/kws/boot.sh index 37ea002..e6110dd 100644 --- a/examples/kws/boot.sh +++ b/examples/kws/boot.sh @@ -15,9 +15,13 @@ EOF set -e -echo "🤫 等待网络连接中..." +# 等待能够正常访问 baidu.com +while ! ping -c 1 baidu.com > /dev/null 2>&1; do + echo "🤫 等待网络连接中..." + sleep 1 +done -sleep 5 +echo "✅ 网络连接成功" MIN_SPACE_MB=32 DOWNLOAD_BASE_URL="https://gitee.com/idootop/artifacts/releases/download/open-xiaoai-kws" diff --git a/packages/client-rust/boot.sh b/packages/client-rust/boot.sh index 7f02dcf..3df72fa 100644 --- a/packages/client-rust/boot.sh +++ b/packages/client-rust/boot.sh @@ -15,9 +15,13 @@ EOF set -e -echo "🤫 等待网络连接中..." +# 等待能够正常访问 baidu.com +while ! ping -c 1 baidu.com > /dev/null 2>&1; do + echo "🤫 等待网络连接中..." + sleep 1 +done -sleep 5 +echo "✅ 网络连接成功" DOWNLOAD_BASE_URL="https://gitee.com/idootop/artifacts/releases/download/open-xiaoai-client" From 0f75a10b9f451213384dff67ca4486c8099bbff2 Mon Sep 17 00:00:00 2001 From: Del Wang Date: Wed, 10 Dec 2025 18:27:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20xiaozhi=20?= =?UTF-8?q?=E8=87=AA=E5=90=AF=E5=8A=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/kws/boot.sh | 2 ++ examples/xiaozhi/scripts/boot.sh | 48 ++++++++++++++++++++++++++++++++ examples/xiaozhi/scripts/init.sh | 25 +++++++++++++++++ packages/client-rust/boot.sh | 2 ++ 4 files changed, 77 insertions(+) create mode 100644 examples/xiaozhi/scripts/boot.sh create mode 100644 examples/xiaozhi/scripts/init.sh diff --git a/examples/kws/boot.sh b/examples/kws/boot.sh index e6110dd..65ccb78 100644 --- a/examples/kws/boot.sh +++ b/examples/kws/boot.sh @@ -21,6 +21,8 @@ while ! ping -c 1 baidu.com > /dev/null 2>&1; do sleep 1 done +sleep 3 + echo "✅ 网络连接成功" MIN_SPACE_MB=32 diff --git a/examples/xiaozhi/scripts/boot.sh b/examples/xiaozhi/scripts/boot.sh new file mode 100644 index 0000000..8985155 --- /dev/null +++ b/examples/xiaozhi/scripts/boot.sh @@ -0,0 +1,48 @@ +#! /bin/sh + +exec > /dev/null 2>&1 + +cat << 'EOF' + +▄▖ ▖▖▘ ▄▖▄▖ +▌▌▛▌█▌▛▌▚▘▌▀▌▛▌▌▌▐ +▙▌▙▌▙▖▌▌▌▌▌█▌▙▌▛▌▟▖ + ▌ + +v1.0.0 by: https://del.wang + +EOF + +set -e + +# 等待能够正常访问 baidu.com +while ! ping -c 1 baidu.com > /dev/null 2>&1; do + echo "🤫 等待网络连接中..." + sleep 1 +done + +sleep 3 + +echo "✅ 网络连接成功" + +DOWNLOAD_BASE_URL="https://gitee.com/idootop/artifacts/releases/download" + +WORK_DIR="/data/open-xiaoai/scripts" + +if [ ! -d "$WORK_DIR" ]; then + mkdir -p "$WORK_DIR" +fi + +if [ ! -f "$WORK_DIR/client-boot.sh" ]; then + curl -L -# -o "$WORK_DIR/client-boot.sh" "$DOWNLOAD_BASE_URL/open-xiaoai-client/boot.sh" +fi + +if [ ! -f "$WORK_DIR/kws-boot.sh" ]; then + curl -L -# -o "$WORK_DIR/kws-boot.sh" "$DOWNLOAD_BASE_URL/open-xiaoai-kws/boot.sh" +fi + +kill -9 `ps|grep "open-xiaoai/kws/monitor"|grep -v grep|awk '{print $1}'` > /dev/null 2>&1 || true + +sh "$WORK_DIR/kws-boot.sh" --no-monitor > /dev/null 2>&1 & + +sh "$WORK_DIR/client-boot.sh" diff --git a/examples/xiaozhi/scripts/init.sh b/examples/xiaozhi/scripts/init.sh new file mode 100644 index 0000000..dc755e0 --- /dev/null +++ b/examples/xiaozhi/scripts/init.sh @@ -0,0 +1,25 @@ +#! /bin/sh + +set -e + +DOWNLOAD_BASE_URL="https://gitee.com/idootop/artifacts/releases/download" + +WORK_DIR="/data/open-xiaoai/scripts" + +if [ ! -d "$WORK_DIR" ]; then + mkdir -p "$WORK_DIR" +fi + +if [ ! -f "$WORK_DIR/client.sh" ]; then + curl -L -# -o "$WORK_DIR/client.sh" "$DOWNLOAD_BASE_URL/open-xiaoai-client/init.sh" +fi + +if [ ! -f "$WORK_DIR/kws.sh" ]; then + curl -L -# -o "$WORK_DIR/kws.sh" "$DOWNLOAD_BASE_URL/open-xiaoai-kws/init.sh" +fi + +kill -9 `ps|grep "open-xiaoai/kws/monitor"|grep -v grep|awk '{print $1}'` > /dev/null 2>&1 || true + +sh "$WORK_DIR/kws.sh" --no-monitor > /dev/null 2>&1 & + +sh "$WORK_DIR/client.sh" diff --git a/packages/client-rust/boot.sh b/packages/client-rust/boot.sh index 3df72fa..bc23cbc 100644 --- a/packages/client-rust/boot.sh +++ b/packages/client-rust/boot.sh @@ -21,6 +21,8 @@ while ! ping -c 1 baidu.com > /dev/null 2>&1; do sleep 1 done +sleep 3 + echo "✅ 网络连接成功" DOWNLOAD_BASE_URL="https://gitee.com/idootop/artifacts/releases/download/open-xiaoai-client"