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"