Shell script with "-i" as input parameter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
07-24-2016
10:34 PM
- last edited on
03-04-2025
08:49 AM
by
kh-richa_mig
Hi,
I've search through discussion and haven't found any similar question yet.
I've been given a shell script install.sh, which runs a McAfee EPM install.
In order to run it, it needs either
install.sh -i (i for install)
install.sh -u (u for uninstall)
I have uploaded this script onto Casper JSS scripts, but I'm getting a fail. Should I be putting "-i" in parameter 4 of the script policy? (I tried, it didn't work)
- Labels:
-
Jamf Pro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-24-2016 11:08 PM
You may have better luck if you put this script in a PKG via Casper Composer. McAfee's installer.sh script as-is can be a pain.
Install the script into a temp folder, then have a postinstall script in the PKG that runs the install command with the flag you need. I use method for my McAfee package. I also have it do an uninstall of previous known versions before it loads the new ePO agent so I can always use -i. I've found -u is unreliable... At least in my environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-24-2016 11:12 PM
The McAfee ePO Agent is probably the worst case of "We don't care how bad it is, they keep buying it, so we ain't changing a thing" development in the business.
That team should be fired, and the work handed off to the team responsible for the well designed, signed and flat PKG installer for the McAfee EPM Client.
You'll need to wrap install.sh
and put it somewhere like /tmp
, then use a postinstallation script to invoke the install. Check out the attached screenshots.
https://donmontalvo.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-25-2016 05:35 AM
I use the script found here https://github.com/franton/McAfee-Agent and it works great. It checks for the existence of McAfee folders. If the folders already exist, it uses the -u switch. If the folders don't already exist, it uses the -i switch. This is great for when you have various computers in different states of install/upgrade.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-25-2016 03:43 PM
-i needs to be $1 casper already uses this and moves the first parameter to $4
If you want to use it directly you will need to look inside the script and find where is checking the -i (probably has and if or else statement containg $1 and change it to reference $4 instead.
There may be multiple references so it could get complex.
But yeah as suggested, just deliver it to the machine in a .DMG and call it from another script or command line option in a policy.
