This has probably been brought up before but I couldn't find anything in
the archives. Anyway, I have a policy setup to run two scripts that need
to be run in a certain order. They are named in alphabetical order.
However, there is no consistency to which order they really run. If you
edit the policy they are listed in the proper order, but if you look at
the policy "plan" the order is opposite. When I actually run the policy
on a computer they run in random order. So, what is the proper way to
get scripts to run in order?
just to be sure, are they both set to the same 'priority' of before, after
or at reboot?
If one was set to after, it would run second, even if the name was alphabetically first, I believe.
Senior Macintosh Support Technician
Kohl's Mac Support Team
262.703.1396 | benjamin.janowski at kohls.com
What I do is that I set up scripts as manual trigger policies, so that
in a parent script it executes them in order. That way I don't have to
worry about using numbers and letters to do the alpha numeric system of
So, for example:
tons of parent commands
jamf policy -trigger myscript1
more unix commands
jamf policy -trigger myscript2
So I execute the script when need be, or the command. I then
consolidate scripts with Casper features. Like for example my bind
script is not needed, as the Casper client can set BIND by smart group
and auto run data.
Ryan, you can call different languages with in the same script...
my shell commands
#calling php /usr/bin/php <<EOF
a bunch of php commands EOF
last unix commands
I do this all the time with in shell for other languages. Well, not
all the time, but sometimes.
Yes, in my post image script I call Apple Script and it uses shell
variables. Below you can see shell variables being input into a Apple
Script, also what you write in PHP can probably be translated into a
different language. I don't know a lot of PHP but if you could describe
what you want to accomplish we could maybe do it all in shell
/usr/bin/osascript <<AppleScript tell application "System Events" keystroke "$admin1_short" keystroke return delay 3.0 keystroke "$admin1_passwd" delay 3.0 keystroke tab keystroke return end tell AppleScript
It is basically calling variables for user name and password that are
hard coded in my shell script.