Update script
This commit is contained in:
parent
335b2eab91
commit
5d0c35a626
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user