Skip to content

Commit

Permalink
Handle pgrep that doesn't have -c
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Mar 29, 2021
1 parent 600ec1c commit cbc9294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var ShellBackgroundCommand = []string{
"sleep " + fmt.Sprintf("%d", waitForConnect),
// As long as a user has a shell open, this task will keep running
"while true",
"do EXECCMD=\"$(pgrep -f ssm-session-worker\\ ecs-execute-command)\"",
"do EXECCMD=\"$(pgrep -f ssm-session-worker\\ ecs-execute-command | wc -l)\"",
"test \"$EXECCMD\" -eq 0 && exit",
// Timeout if exceeds max lifetime
"test \"$STOP\" -lt \"$(date +%s)\" && exit 1",
Expand Down

0 comments on commit cbc9294

Please sign in to comment.