From 28ba13818247659f9fecf14621e8d36553499e2b Mon Sep 17 00:00:00 2001 From: lz1998 <875543533@qq.com> Date: Tue, 6 Apr 2021 01:28:03 +0800 Subject: [PATCH] scripts --- build.sh | 1 + scripts/env_run.sh | 29 +++++++++++++++++++++++++++++ scripts/linux_run.sh | 7 +++++++ scripts/windows_run.bat | 17 +++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100755 scripts/env_run.sh create mode 100755 scripts/linux_run.sh create mode 100644 scripts/windows_run.bat diff --git a/build.sh b/build.sh index 4ba8165..5377537 100755 --- a/build.sh +++ b/build.sh @@ -46,6 +46,7 @@ done #cp application.yml "${OUTPUT_DIR}/application.yml" cp -r static "${OUTPUT_DIR}/static" # https://github.com/ProtobufBot/Client-UI 前端编译产物dist +cp ./scripts/* "${OUTPUT_DIR}/" # 复制运行脚本 echo "可以把不要的系统删掉">"${OUTPUT_DIR}/可以把不要的系统删掉" diff --git a/scripts/env_run.sh b/scripts/env_run.sh new file mode 100755 index 0000000..76eb820 --- /dev/null +++ b/scripts/env_run.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +cmd="gmc " + +if [ $UIN ];then + cmd+="-uin $UIN " +fi + +if [ $PASS ];then + cmd+="-pass $PASS " +fi + +if [ $PORT ];then + cmd+="-port $PORT " +fi + +if [ $WS_URL ];then + cmd+="-ws_url $WS_URL " +fi + +if [ $SMS ];then + cmd+="-sms $SMS " +fi + +if [ $DEVICE ];then + cmd+="-device $DEVICE " +fi + +eval $cmd \ No newline at end of file diff --git a/scripts/linux_run.sh b/scripts/linux_run.sh new file mode 100755 index 0000000..3938b4e --- /dev/null +++ b/scripts/linux_run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +read -p "Enter your bot qq:" uin +read -p "Enter your bot password:" pass + +# 根据情况修改使用哪个 +Go-Mirai-Client-linux-amd64 -uin "$uin" -pass "$pass" \ No newline at end of file diff --git a/scripts/windows_run.bat b/scripts/windows_run.bat new file mode 100644 index 0000000..002dceb --- /dev/null +++ b/scripts/windows_run.bat @@ -0,0 +1,17 @@ +@echo off + +echo ================================================ +echo Go-Mirai-Client +echo You can modify this file to login automatically. +echo You can copy this file to manage many bots. +echo https://github.com/ProtobufBot/go-Mirai-Client +echo ================================================ + +set port=9000 + +set /p uin=QQ: +set /p pass=Password: +set /p port=Port(9000-60000): + + +Go-Mirai-Client-windows-amd64.exe -uin %uin% -pass %pass% -port %port% \ No newline at end of file