Posted on 02-08-2017 10:04 PM
Hi all,
I have a install.sh script, and to run it, I manually would have to do "sudo sh install.sh -i"
If I put it to JSS, I notice in the script options, there are parameter 4, parameter 5, etc.
Can I just add in my script, then have a policy that calls the script with parameter 4 = -i ?
Solved! Go to Solution.
Posted on 02-08-2017 10:56 PM
Hi @Bernard.Huang ,
you can wrap that install.sh in a installation package. Copy the install.sh to /private/tmp, add a post install script with the following content:
#!/bin/bash
sh /private/tmp/install.sh -i
exit 0
You don't need sudo in scripts executed as pre- or postinstall package scripts because they are already executed as root.
Posted on 02-08-2017 10:56 PM
Hi @Bernard.Huang ,
you can wrap that install.sh in a installation package. Copy the install.sh to /private/tmp, add a post install script with the following content:
#!/bin/bash
sh /private/tmp/install.sh -i
exit 0
You don't need sudo in scripts executed as pre- or postinstall package scripts because they are already executed as root.
Posted on 02-09-2017 12:36 AM
Thanks for that.
I also thought of your solution, but when I saw the parameters, I thought, if it worked, would make it even easler.
Posted on 02-09-2017 08:41 AM
The parameter method will not work, because parameters 1 to 3 are hard-coded by the JSS to target volume, computer name and user name - so you would be issuing "install.sh / myComputer myUser -i" instead of "install.sh -i". Better repackage the script into a payload-free package.
Is it McAfee you are trying to install?
Posted on 02-09-2017 03:34 PM
Yes, you are correct. I am trying to install McAfee.
With the El Capitan > Sierra upgrade happening, our security team are providing us a new McAfee. So I need to push it to every Macbook.
With everyone's information, I'm about 50% through my scripting and testing, so thank you everyone :)