#!/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
        echo "Java应用运行中，PID: $PID"
        echo "端口占用:"
        netstat -tlnp 2>/dev/null | grep $PID || ss -tlnp 2>/dev/null | grep $PID
    else
        echo "Java应用未运行"
    fi
else
    echo "Java应用未运行"
fi
