#!/bin/bash
cd "$(dirname "$0")"
if [ -f "AliPack.jar.pid" ]; then
    PID=$(cat AliPack.jar.pid)
    if ps -p $PID > /dev/null 2>&1; then
        kill $PID
        sleep 2
        if ps -p $PID > /dev/null 2>&1; then
            kill -9 $PID
        fi
        rm -f AliPack.jar.pid
        echo "Java应用已停止"
    else
        echo "Java应用未运行"
        rm -f AliPack.jar.pid
    fi
else
    echo "未找到PID文件"
fi
