Fixes #4713: check-rudder-agent script is no longer sh/dash compatible d...

...ue to function definition