469 Unstar Star 1.1K Fork 519

茹憶。 / Lepus

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
lepus 1.67 KB
Copy Edit Web IDE Raw Blame History
茹憶。 authored 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

Comment ( 0 )

Sign in for post a comment

Python
1
https://git.oschina.net/ruzuojun/Lepus.git
git@git.oschina.net:ruzuojun/Lepus.git
ruzuojun
Lepus
Lepus
master

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542