728x90
반응형
#!/bin/bash
PID=$(ps -eo pid,comm | awk '$2 == "test-demon.sh" {print $1}')

if [ -z "$PID" ]; then
  echo "... not running"
else
  echo "... running"
  echo ${PID}
fi

 

결과

 

반응형

+ Recent posts