Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
Signed-off-by: Teddysun <[email protected]>
  • Loading branch information
teddysun committed Jun 7, 2018
1 parent 04015f4 commit f93fb43
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
12 changes: 6 additions & 6 deletions shadowsocks
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

# Author: Teddysun <[email protected]>

NAME=Shadowsocks
if [ -f /usr/bin/ssserver ]; then
BIN=/usr/bin/ssserver
DAEMON=/usr/bin/ssserver
elif [ -f /usr/local/bin/ssserver ]; then
BIN=/usr/local/bin/ssserver
DAEMON=/usr/local/bin/ssserver
fi
NAME=Shadowsocks
if [ -f /etc/shadowsocks-python/config.json ]; then
CONF=/etc/shadowsocks-python/config.json
elif [ -f /etc/shadowsocks.json ]; then
Expand All @@ -28,7 +28,7 @@ fi
RETVAL=0

check_running(){
PID=$(ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}')
PID=$(ps -ef | grep -v grep | grep -i "${DAEMON}" | awk '{print $2}')
if [ -n "$PID" ]; then
return 0
else
Expand All @@ -42,7 +42,7 @@ do_start(){
echo "$NAME (pid $PID) is already running..."
exit 0
else
$BIN -c $CONF -d start
$DAEMON -c $CONF -d start
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Starting $NAME success"
Expand All @@ -55,7 +55,7 @@ do_start(){
do_stop(){
check_running
if [ $? -eq 0 ]; then
$BIN -c $CONF -d stop
$DAEMON -c $CONF -d stop
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Stopping $NAME success"
Expand Down
12 changes: 6 additions & 6 deletions shadowsocks-debian
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

# Author: Teddysun <[email protected]>

NAME=Shadowsocks
if [ -f /usr/bin/ssserver ]; then
BIN=/usr/bin/ssserver
DAEMON=/usr/bin/ssserver
elif [ -f /usr/local/bin/ssserver ]; then
BIN=/usr/local/bin/ssserver
DAEMON=/usr/local/bin/ssserver
fi
NAME=Shadowsocks
if [ -f /etc/shadowsocks-python/config.json ]; then
CONF=/etc/shadowsocks-python/config.json
elif [ -f /etc/shadowsocks.json ]; then
Expand All @@ -26,7 +26,7 @@ fi
RETVAL=0

check_running(){
PID=$(ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}')
PID=$(ps -ef | grep -v grep | grep -i "${DAEMON}" | awk '{print $2}')
if [ -n "$PID" ]; then
return 0
else
Expand All @@ -40,7 +40,7 @@ do_start(){
echo "$NAME (pid $PID) is already running..."
exit 0
else
$BIN -c $CONF -d start
$DAEMON -c $CONF -d start
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Starting $NAME success"
Expand All @@ -53,7 +53,7 @@ do_start(){
do_stop(){
check_running
if [ $? -eq 0 ]; then
$BIN -c $CONF -d stop
$DAEMON -c $CONF -d stop
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Stopping $NAME success"
Expand Down
10 changes: 5 additions & 5 deletions shadowsocks-go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
[ ${NETWORKING} ="yes" ] || exit 0

NAME=Shadowsocks-go
BIN=/usr/bin/shadowsocks-server
DAEMON=/usr/bin/shadowsocks-server
if [ -f /etc/shadowsocks-go/config.json ]; then
CONF=/etc/shadowsocks-go/config.json
elif [ -f /etc/shadowsocks/config.json ]; then
Expand All @@ -31,19 +31,19 @@ PID_DIR=/var/run
PID_FILE=$PID_DIR/shadowsocks-go.pid
RET_VAL=0

[ -x $BIN ] || exit 0
[ -x $DAEMON ] || exit 0

if [ ! -d $PID_DIR ]; then
mkdir -p $PID_DIR
if [ $? -ne 0 ]; then
echo "Creating PID directory $PID_DIR failed"
exit 1
RET_VAL=1
fi
fi

if [ ! -f $CONF ]; then
echo "$NAME config file $CONF not found"
exit 1
RET_VAL=1
fi

check_running() {
Expand Down Expand Up @@ -78,7 +78,7 @@ do_start() {
echo "$NAME (pid $PID) is already running..."
return 0
fi
$BIN -c $CONF 2>&1 > /dev/null &
$DAEMON -c $CONF 2>&1 > /dev/null &
PID=$!
echo $PID > $PID_FILE
sleep 0.3
Expand Down
10 changes: 5 additions & 5 deletions shadowsocks-go-debian
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Author: Teddysun <[email protected]>

NAME=Shadowsocks-go
BIN=/usr/bin/shadowsocks-server
DAEMON=/usr/bin/shadowsocks-server
if [ -f /etc/shadowsocks-go/config.json ]; then
CONF=/etc/shadowsocks-go/config.json
elif [ -f /etc/shadowsocks/config.json ]; then
Expand All @@ -23,19 +23,19 @@ PID_DIR=/var/run
PID_FILE=$PID_DIR/shadowsocks-go.pid
RET_VAL=0

[ -x $BIN ] || exit 0
[ -x $DAEMON ] || exit 0

if [ ! -d $PID_DIR ]; then
mkdir -p $PID_DIR
if [ $? -ne 0 ]; then
echo "Creating PID directory $PID_DIR failed"
exit 1
RET_VAL=1
fi
fi

if [ ! -f $CONF ]; then
echo "$NAME config file $CONF not found"
exit 1
RET_VAL=1
fi

check_running() {
Expand Down Expand Up @@ -70,7 +70,7 @@ do_start() {
echo "$NAME (pid $PID) is already running..."
return 0
fi
$BIN -c $CONF 2>&1 > /dev/null &
$DAEMON -c $CONF 2>&1 > /dev/null &
PID=$!
echo $PID > $PID_FILE
sleep 0.3
Expand Down
4 changes: 2 additions & 2 deletions shadowsocks-libev
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ if [ ! -d $PID_DIR ]; then
mkdir -p $PID_DIR
if [ $? -ne 0 ]; then
echo "Creating PID directory $PID_DIR failed"
exit 1
RET_VAL=1
fi
fi

if [ ! -f $CONF ]; then
echo "$NAME config file $CONF not found"
exit 1
RET_VAL=1
fi

check_running() {
Expand Down
4 changes: 2 additions & 2 deletions shadowsocks-libev-debian
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ if [ ! -d $PID_DIR ]; then
mkdir -p $PID_DIR
if [ $? -ne 0 ]; then
echo "Creating PID directory $PID_DIR failed"
exit 1
RET_VAL=1
fi
fi

if [ ! -f $CONF ]; then
echo "$NAME config file $CONF not found"
exit 1
RET_VAL=1
fi

check_running() {
Expand Down
8 changes: 4 additions & 4 deletions shadowsocksR
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Author: Teddysun <[email protected]>

NAME=ShadowsocksR
BIN=/usr/local/shadowsocks/server.py
DAEMON=/usr/local/shadowsocks/server.py
if [ -f /etc/shadowsocks-r/config.json ]; then
CONF=/etc/shadowsocks-r/config.json
elif [ -f /etc/shadowsocks.json ]; then
Expand All @@ -24,7 +24,7 @@ fi
RETVAL=0

check_running(){
PID=$(ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}')
PID=$(ps -ef | grep -v grep | grep -i "${DAEMON}" | awk '{print $2}')
if [ -n "$PID" ]; then
return 0
else
Expand All @@ -38,7 +38,7 @@ do_start(){
echo "$NAME (pid $PID) is already running..."
exit 0
else
$BIN -c $CONF -d start
$DAEMON -c $CONF -d start
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Starting $NAME success"
Expand All @@ -51,7 +51,7 @@ do_start(){
do_stop(){
check_running
if [ $? -eq 0 ]; then
$BIN -c $CONF -d stop
$DAEMON -c $CONF -d stop
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Stopping $NAME success"
Expand Down
8 changes: 4 additions & 4 deletions shadowsocksR-debian
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Author: Teddysun <[email protected]>

NAME=ShadowsocksR
BIN=/usr/local/shadowsocks/server.py
DAEMON=/usr/local/shadowsocks/server.py
if [ -f /etc/shadowsocks-r/config.json ]; then
CONF=/etc/shadowsocks-r/config.json
elif [ -f /etc/shadowsocks.json ]; then
Expand All @@ -22,7 +22,7 @@ fi
RETVAL=0

check_running(){
PID=$(ps -ef | grep -v grep | grep -i "${BIN}" | awk '{print $2}')
PID=$(ps -ef | grep -v grep | grep -i "${DAEMON}" | awk '{print $2}')
if [ -n "$PID" ]; then
return 0
else
Expand All @@ -36,7 +36,7 @@ do_start(){
echo "$NAME (pid $PID) is already running..."
exit 0
else
$BIN -c $CONF -d start
$DAEMON -c $CONF -d start
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Starting $NAME success"
Expand All @@ -49,7 +49,7 @@ do_start(){
do_stop(){
check_running
if [ $? -eq 0 ]; then
$BIN -c $CONF -d stop
$DAEMON -c $CONF -d stop
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Stopping $NAME success"
Expand Down

0 comments on commit f93fb43

Please sign in to comment.