12345678910111213141516171819202122232425 |
- #!/usr/bin/env bash
- set -e
- cat << 'LOGO'
- ----------------------------------
- LOGO
- base_dir=$(
- cd "$(dirname "$0")"
- pwd
- )
- cd $base_dir
- pid=$(ps -auxc | grep traefik | grep -vE "grep|-Xmx700m" | awk '{print $2}')
- if [[ $pid == "" ]]; then
- echo "traefik未在运行"
- else
- running_time=$(ps -o etime= -p "$pid")
- ports=$(netstat -tnlp | grep -w ./traefik | head -n +1 | awk '{print $4}')
- echo "lb当前PID: $pid"
- echo "当前运行时间: $running_time" | tr -s " "
- echo "当前运行端口:"
- for i in "$ports"; do
- echo "$i"
- done
- fi
- echo -e "\n"
|