From ca667eff93175f2046d384c2a84c384ac799a865 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 25 Aug 2019 14:27:05 +0800 Subject: [PATCH] luci-app-serverchan: fix cannot stop/remove --- .../luci-app-serverchan/root/etc/init.d/serverchan | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/package/cnsztl/luci-app-serverchan/root/etc/init.d/serverchan b/package/cnsztl/luci-app-serverchan/root/etc/init.d/serverchan index 2aff7bfff3..3d8f1a262f 100755 --- a/package/cnsztl/luci-app-serverchan/root/etc/init.d/serverchan +++ b/package/cnsztl/luci-app-serverchan/root/etc/init.d/serverchan @@ -2,13 +2,12 @@ START=99 STOP=10 - start() { -flag=$(ps | grep "serverchan/serverchan" | grep -v "grep" | wc -l) -if [ $flag -eq 0 ] ;then -/usr/bin/serverchan/serverchan & -fi + flag="$(ps | grep "serverchan/serverchan" | grep -v "grep" | wc -l)" + if [ "${flag}" -eq "0" ] ;then + /usr/bin/serverchan/serverchan >/dev/null 2>&1 & + fi } stop() { -kill -9 `pgrep -f serverchan` -} + kill -9 "$(pgrep -f serverchan/serverchan)" >/dev/null 2>&1 +} \ No newline at end of file