1 Star 0 Fork 759

penzigo/Lepus

forked from LepusGroup/lepus 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lepus 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
ruzuojun 提交于 2017-08-07 15:36 . 代码目录调整,修改readme
#!/bin/bash
basedir="/usr/local/lepus"
#check basedir
#############################################################################
if test -z "$basedir"
then
basedir=/usr/local/lepus
else
basedir="$basedir"
fi
arg=$1
lepus_process=`ps -ef|grep lepus.py |grep -v grep|wc -l`
case "$arg" in
'status')
#check lepus status
if [ $lepus_process -ge "2" ];then
echo "lepus server is running..."
else
echo "lepus server is not run!"
fi
;;
'start')
#start lepus
if [ $lepus_process -ge "2" ];then
echo " lepus server is already run!"
else
cd $basedir && nohup python lepus.py &> logs/lepus.log&
sleep 5
lepus_process=`ps -ef|grep lepus.py |grep -v grep|wc -l`
if [ $lepus_process -ge "2" ];then
echo "lepus server start success!"
else
echo "lepus server start fail!"
fi
fi
;;
'stop')
#stop lepus
if [ $lepus_process -le "2" ];then
echo "lepus server is not running!"
else
ps -ef |grep -i -E "lepus.py"|grep -v -E "vi|grep"|awk '{print $2}' |while read line; do kill $line; echo "lepus processes id $line been stop"; done
#killall python lepus.py*
fi
;;
'--help')
#for help
echo "lepus help:"
echo "support-site: www.lepus.cc"
echo "===================================================================="
echo "start Start lepus monitor server; Command: #lepus start"
echo "stop Stop lepus monitor server; Command: #lepus stop"
echo "status Check lepus monitor run status; Command: #lepus status"
;;
*)
echo "Please input --help to read the help info."
;;
esac
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/penzigo/Lepus.git
git@gitee.com:penzigo/Lepus.git
penzigo
Lepus
Lepus
master

搜索帮助