Same script run multiple times always has the same arguments

jamesreynolds
New Contributor III

I created a pretty generic script to run defaults commands with the intention that the arguments would do all the work. If I create a policy that has that script specified several times, every instance of the script uses the arguments of the first one. I would've thought that if I added a script several times that it would let me specify different arguments.

Is this a bug?da14da301cdb4cfc9fba3c4f48fce5bd

6 REPLIES 6

hinrichd
New Contributor III

Try to create ingremented duplicates of the script you want to run twice or more times in a policy. Something like

Preferences01.sh
Preferences02.sh .
.
.
I heard something about this bug some time ago, but not that shure.

MattAebly
Contributor II
Contributor II

Hey James,

That does look to be a current Product Issue. I'd suggest creating a case with Support and they can tie the case to the Product Issue to bring more impact to it.

jamesreynolds
New Contributor III

Ok I'll create a bug.

Look
Valued Contributor III

As far as I know it's always behaved like this, there is almost certainly a feature request around somewhere asking for it to be changed.
Rather than having several seperate scripts it's probably cleaner and easier to have linked policies (or sequentially named ones).
You can create several policies each with the script with different arguments all set to the same custom trigger, you make one

jamf policy -event "CUSTOMTRIGGER"

call from a main policy.

jamesreynolds
New Contributor III

There's lots of ways around this problem but I'm striving to keep my policy list as short as possible, and having multiple policies that really should be one just makes it a mess. It also cripples the power of generalized scripts.

lhnguyen1
New Contributor II

I'm currently in the same boat with you @jamesreynolds , did support have any suggestions?