Skip to main content
Question

Same script run multiple times always has the same arguments


Forum|alt.badge.img+4

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?

6 replies

Forum|alt.badge.img+7
  • Contributor
  • 27 replies
  • May 31, 2017

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
Forum|alt.badge.img+16
  • Employee
  • 105 replies
  • May 31, 2017

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.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 12 replies
  • May 31, 2017

Ok I'll create a bug.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • May 31, 2017

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.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 12 replies
  • June 2, 2017

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.


Forum|alt.badge.img+3
  • New Contributor
  • 2 replies
  • June 28, 2017

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings