How the policy run according to the script result.

New Contributor II

Hi everyone,
I have a script and this script downloading some packages from Apple Server. There is also one more seperate standalone package. if the first download step is successful (script result 0) then standalone package should work via script. How can I do this automation with script ?


Legendary Contributor III

I'm not sure I entirely understand what you're trying to achieve. You have 2 scripts? The first one downloads software updates/packages and the second one does what exactly?

New Contributor II

Hi @mm2270 I have only one script. The first one downloading some applications.
But this script can may fail because of internet connection issue or any other. that's why I want catch script result.
For example, if script result 0 (download successfully done) then second will policy will work. If download failed then first script will work again.

Valued Contributor

@emre.uydu Can you post your script, removing any confidential data, so we can see what you are trying to do? I think I understand your workflow, but not 100%. One idea would to call the second part of your installation in a different policy with a custom trigger. You could then add error checking in your original script to only proceed if the initial downloads were successful.