Posted on 02-11-2014 11:02 AM
I have a post-installation bash script for a package where I want to have different logic to determine whether the package is being deployed via Self Service vs a policy. For example, I may want to have different jamfHelper messages to appear depending upon the method of deployment. I would keep the advantage of having a single package, rather than creating separate packages for each deployment method.
I am at a loss as to how to determine the logic. I would appreciate it if somebody can point me in the right direction. Thanks.
Solved! Go to Solution.
Posted on 02-11-2014 03:10 PM
Depending on what the script is doing, you could move the postflight script to a Casper script that runs after the package installs, leveraging script parameters in the policy to alter the behavior for different policies.
Posted on 02-11-2014 11:39 AM
The only way I can think of offhand to do this would be to have the script scan the last 10 or so lines of the jamf.log and look for the policy name being run. If it finds the name of the regular (non Self Service) policy in the recent lines in the log, then its likely being run out of that policy. If it finds the Self Service policy name, its probably being run from that. I assume each policy has a somewhat different name, correct? And that they wouldn't both get run simultaneously.
Posted on 02-11-2014 03:10 PM
Depending on what the script is doing, you could move the postflight script to a Casper script that runs after the package installs, leveraging script parameters in the policy to alter the behavior for different policies.
Posted on 02-12-2014 07:52 AM
@alexjdale, I thought about that possibility this morning. My intended script is a post-installation script, so I am thinking it should work as well. On to testing to verify! Thanks.