fix(web): 修正停止脚本中的进程查找命令
- 将 'ps ef' 修改为 'ps -ef',以确保在所有用户进程中查找 - 优化了进程查找逻辑,提高了脚本的准确性和可靠性
This commit is contained in:
@@ -4,7 +4,7 @@ original_command="$0"
|
|||||||
application_name="gringotts-web-1.0.0-SNAPSHOT.jar"
|
application_name="gringotts-web-1.0.0-SNAPSHOT.jar"
|
||||||
|
|
||||||
function get_pid() {
|
function get_pid() {
|
||||||
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
ID=$(ps -ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||||
if [[ -z "$ID" ]]; then
|
if [[ -z "$ID" ]]; then
|
||||||
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||||
if [[ -z "$ID" ]]; then
|
if [[ -z "$ID" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user