#!/bin/bash ROOT=$(cd `dirname $0`/; pwd) status(){ pid=$(ps -auxc | grep $1 | grep -vE "grep|-Xmx700m" | awk '{print $2}') if [[ $pid == "" ]]; then echo "--- $1 未在运行" else # running_time=$(ps -o etime= -p "$pid") echo "--- $1 正在在运行" echo "当前PID: $pid" # echo "当前运行时间: $running_time" | tr -s " " fi } status smqlookupd status smqd status smqdBackup status smqweb cd $ROOT/lb $ROOT/lb/status.sh