From 8729a31119a4b4c516803c41f3971c0da3d9643f Mon Sep 17 00:00:00 2001 From: zwssunny Date: Tue, 28 Feb 2023 08:46:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAscripts=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E4=B8=93=E9=97=A8=E6=94=BE=E8=B0=83=E7=94=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shutdown.sh => scripts/shutdown.sh | 2 +- start.sh => scripts/start.sh | 1 + scripts/tout.sh | 14 ++++++++++++++ tout.sh | 7 ------- 4 files changed, 16 insertions(+), 8 deletions(-) rename shutdown.sh => scripts/shutdown.sh (95%) rename start.sh => scripts/start.sh (95%) create mode 100755 scripts/tout.sh delete mode 100755 tout.sh diff --git a/shutdown.sh b/scripts/shutdown.sh similarity index 95% rename from shutdown.sh rename to scripts/shutdown.sh index bf3a476..c2bf6b1 100755 --- a/shutdown.sh +++ b/scripts/shutdown.sh @@ -1,7 +1,7 @@ #!/bin/bash #关闭服务 - +cd `dirname $0`/.. export BASE_DIR=`pwd` pid=`ps ax | grep -i app.py | grep "${BASE_DIR}" | grep python3 | grep -v grep | awk '{print $1}'` if [ -z "$pid" ] ; then diff --git a/start.sh b/scripts/start.sh similarity index 95% rename from start.sh rename to scripts/start.sh index 8a0dc15..ac92f88 100755 --- a/start.sh +++ b/scripts/start.sh @@ -1,6 +1,7 @@ #!/bin/bash #后台运行Chat_on_webchat执行脚本 +cd `dirname $0`/.. export BASE_DIR=`pwd` echo $BASE_DIR diff --git a/scripts/tout.sh b/scripts/tout.sh new file mode 100755 index 0000000..5b71491 --- /dev/null +++ b/scripts/tout.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#打开日志 + +cd `dirname $0`/.. +export BASE_DIR=`pwd` +echo $BASE_DIR + +# check the nohup.out log output file +if [ ! -f "${BASE_DIR}/nohup.out" ]; then + echo "No file ${BASE_DIR}/nohup.out" + exit -1; +fi + +tail -f "${BASE_DIR}/nohup.out" diff --git a/tout.sh b/tout.sh deleted file mode 100755 index 296d963..0000000 --- a/tout.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -#打开日志 - -export BASE_DIR=`pwd` -echo $BASE_DIR - -tail -f "${BASE_DIR}/nohup.out"