Skip to content

Commit

Permalink
Macos script fix (#377)
Browse files Browse the repository at this point in the history
Co-authored-by: Seth L <[email protected]>
  • Loading branch information
zhihonl and sethAmazon committed Aug 2, 2023
1 parent 3f60a57 commit 6792c77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packaging/darwin/amazon-cloudwatch-agent-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ cwa_status() {

starttime_fmt=''
local pid=$(cwa_pid)
if [[ $pid =~ ^[\-0-9]+$ ]] && ( (pid >0)); then
if [[ $pid =~ ^[\-0-9]+$ ]] && [ "$pid" -gt 0 ]; then
starttime="$(TZ=UTC LC_ALL=C ps -o lstart= "${pid}")"
starttime_fmt="$(TZ=UTC date -jf "%a %b %d %T %Y " "${starttime}" +%FT%T%z)"
else
Expand All @@ -142,7 +142,7 @@ cwa_runstatus() {
running=false
set +e
local pid=$(cwa_pid)
if [[ "$pid" =~ ^[0-9]+$ ]] && ( (pid >0)); then
if [[ "$pid" =~ ^[0-9]+$ ]] && [ "$pid" -gt 0 ]; then
running='true'
elif [[ "$pid" == "-" ]]; then
running='true'
Expand Down

0 comments on commit 6792c77

Please sign in to comment.