From 366431a4c2ab70ae5dc8e280b6ff03edd0bf1998 Mon Sep 17 00:00:00 2001 From: jerry Date: Wed, 28 Nov 2018 18:18:08 +0800 Subject: [PATCH] :rocket: update shell start --- src/cqbot/connection/RobotWSConnection.php | 2 +- run.sh => start-coolq.sh | 0 start-docker-screen.sh | 12 ++++++++++++ start-docker.sh | 3 +++ start-screen.sh | 13 +++++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) rename run.sh => start-coolq.sh (100%) create mode 100755 start-docker-screen.sh create mode 100755 start-docker.sh create mode 100755 start-screen.sh diff --git a/src/cqbot/connection/RobotWSConnection.php b/src/cqbot/connection/RobotWSConnection.php index f337e9b1..8ec94958 100644 --- a/src/cqbot/connection/RobotWSConnection.php +++ b/src/cqbot/connection/RobotWSConnection.php @@ -34,7 +34,7 @@ class RobotWSConnection extends WSConnection Cache::set("version_info", $response["data"]); }); if ($r) - $this->create_success = $this->sendAPI("send_group_msg", ["message" => "[CrazyBot] 机器人 " . $this->getAlias() . " 已连接,链接fd:" . $this->fd, "group_id" => Cache::get("admin_group")]); + $this->create_success = $this->sendAPI("send_group_msg", ["message" => "[CQBot] 机器人 " . $this->getAlias() . " 已连接,链接fd:" . $this->fd, "group_id" => Cache::get("admin_group")]); } else $this->create_success = true; } diff --git a/run.sh b/start-coolq.sh similarity index 100% rename from run.sh rename to start-coolq.sh diff --git a/start-docker-screen.sh b/start-docker-screen.sh new file mode 100755 index 00000000..182a38bf --- /dev/null +++ b/start-docker-screen.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +cq=$(screen -list | grep "cq") +if [[ "$cq" = "" ]]; then + screen -dmS cq +fi +sleep 1s + +screen -x -S cq -p 0 -X stuff "sudo docker run -it --rm --name cqbot -v "$(pwd)"/cqbot/:/root/ jesse2061/cqbot-swoole" +screen -x -S cq -p 0 -X stuff "\n" +screen -x -S cq -p 0 -X stuff "php start.php" +screen -x -S cq -p 0 -X stuff "\n" diff --git a/start-docker.sh b/start-docker.sh new file mode 100755 index 00000000..d7bd2479 --- /dev/null +++ b/start-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo docker run -it --rm --name my-running-script -v $(pwd)/cqbot/:/root/ cqbot \ No newline at end of file diff --git a/start-screen.sh b/start-screen.sh new file mode 100755 index 00000000..46ed6070 --- /dev/null +++ b/start-screen.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cq=$(screen -list | grep "cq") +if [[ "$cq" = "" ]]; then + screen -dmS cq +fi +sleep 1s + +#ls="cd "$(pwd)"/CQBot-swoole/" +#screen -x -S cq -p 0 -X stuff ${ls} +#screen -x -S cq -p 0 -X stuff "\n" +screen -x -S cq -p 0 -X stuff "php start.php" +screen -x -S cq -p 0 -X stuff "\n" \ No newline at end of file