When I started to edit file using vi it was apparent that file had DOS line endings. I just left the code as-is and fixed the line endings and now it autostarts fine