Update script

This commit is contained in:
Teddysun 2016-01-28 22:07:54 +09:00
parent 335b2eab91
commit 5d0c35a626
2 changed files with 8 additions and 9 deletions

View File

@ -28,8 +28,8 @@ start(){
}
stop(){
pid=`ps -ef | grep -v grep | grep -v ps | grep -i "${BIN}" | awk '{print $2}'`
if [ ! -z $pid ]; then
pid=`ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}'`
if [[ ! -z $pid ]]; then
$BIN -c $conf -d stop
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
@ -44,8 +44,8 @@ stop(){
}
status(){
pid=`ps -ef | grep -v grep | grep -v ps | grep -i "${BIN}" | awk '{print $2}'`
if [ -z $pid ]; then
pid=`ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}'`
if [[ -z $pid ]]; then
echo "$name is not running"
RETVAL=1
else

View File

@ -14,7 +14,6 @@
name=shadowsocks
BIN=/usr/local/bin/ssserver
conf=/etc/shadowsocks.json
#pid=/var/run/shadowsocks.pid
start(){
$BIN -c $conf -d start
@ -27,8 +26,8 @@ start(){
}
stop(){
pid=`ps -ef | grep -v grep | grep -v ps | grep -i "/usr/bin/python ${BIN}" | awk '{print $2}'`
if [ ! -z $pid ]; then
pid=`ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}'`
if [[ ! -z $pid ]]; then
$BIN -c $conf -d stop
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
@ -43,8 +42,8 @@ stop(){
}
status(){
pid=`ps -ef | grep -v grep | grep -v ps | grep -i "/usr/bin/python ${BIN}" | awk '{print $2}'`
if [ -z $pid ]; then
pid=`ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}'`
if [[ -z $pid ]]; then
echo "$name is not running"
RETVAL=1
else