#!/bin/bash ####################### # created by code on 2021/10/25 ####################### function stop(){ serviceName=puppeteer-microservice local pid=$(ps aux|grep "puppeteer-microservice"|grep -v grep|awk '{print $2}' 2>>/dev/null)
if [[ -n $pid ]]; then
kill -9 $pid 2>>/dev/null
if [[ $? -ne 0 ]]; then echo -e " Failed to stop service of ${serviceNam}" return 1 else echo -e " Successful to stop service of ${serviceNam}" return 0 fi fi
#!/bin/bash ####################### # created by code on 2021/10/25 ####################### function setVars(){ serviceName=puppeteer-microservice basepath=/home/icampus3.0 jdkHome=${basepath}/jdk8 servHome=${basepath}/pkgs/${serviceName} start=${servHome}/start.sh log=${basepath}/logs/${serviceName}.log npm=/usr/local/n/versions/node/14.18.1/bin/npm option="run start" } function start(){ cd $servHome sh stop.sh echo -e " Start to start up ${serviceName} : "