This is the correct process. I would suggest not using headless or exit after script and see if the first part is working. It could be a name or path issue. Or you can also just run the script interactively to make sure the script is working as expected. Let me know if it helps.