OSX: rework the mess that was start script

(cherry picked from commit 5dd992918e990aed168b06cc2eaa790afbe0dfd5)