This commit is contained in:
luoliangyi 2023-04-15 16:12:19 +08:00
parent fd52055511
commit b337ac33e5
1 changed files with 6 additions and 6 deletions

12
kylin/zjweb/opt/Microtekwebscan/bin/server.sh Normal file → Executable file
View File

@ -5,9 +5,9 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
echo "current dir $DIR" echo "current dir $DIR"
BASE_DIR="$DIR" BASE_DIR="$DIR"
export LD_LIBRARY_PATH="$DIR" export LD_LIBRARY_PATH="$DIR"
APP_NAME=ZJWebService APP_NAME=ZjWebService
APP_PATH="$BASE_DIR/ZJWebService" APP_PATH="$BASE_DIR/ZjWebService"
echo "APP_PATH = $APP_PATH" echo "APP_PATH = $APP_PATH"
LIB_PARH="$BASE_DIR/libzjdriver.so" LIB_PARH="$BASE_DIR/libzjdriver.so"
echo "LIB_PARH = $LIB_PARH" echo "LIB_PARH = $LIB_PARH"
@ -18,17 +18,17 @@ usage() {
exit 1 exit 1
} }
is_exist(){ is_exist(){
if [ ! -f $BASE_DIR/ZJWebService ]; then if [ ! -f $BASE_DIR/ZjWebService ]; then
return 1 return 1
else else
pid=`ps -ef | grep "ZJWebService" | grep -v grep | awk '{print $2}'` pid=`ps -ef | grep "ZjWebService" | grep -v grep | awk '{print $2}'`
echo "PID: $pid" echo "PID: $pid"
appNum=`ps -ef|awk '{print $2}'|grep -c -e "^${pid}\$"` appNum=`ps -ef|awk '{print $2}'|grep -c -e "^${pid}\$"`
echo appNum $appNum echo appNum $appNum
if [ ${appNum} -gt 0 ]; then if [ ${appNum} -gt 0 ]; then
return 0 return 0
else else
rm -rf $BASE_DIR/ZJWebService.pid >/dev/null 2>&1 & rm -rf $BASE_DIR/ZjWebService.pid >/dev/null 2>&1 &
return 1 return 1
fi fi
fi fi
@ -41,7 +41,7 @@ if [ $? -eq "0" ]; then
else else
echo "APP_PATH: $APP_PATH" echo "APP_PATH: $APP_PATH"
echo "LIB_PATH: $LIB_PARH" echo "LIB_PATH: $LIB_PARH"
"$DIR"/ZJWebService & "$DIR"/ZjWebService &
fi fi
} }
#stop webserver #stop webserver