Skip to main content
Question

Shell script with "-i" as input parameter


Forum|alt.badge.img+10

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)

4 replies

Forum|alt.badge.img+12
  • Valued Contributor
  • 139 replies
  • July 25, 2016

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.


donmontalvo
Forum|alt.badge.img+36
  • Legendary Contributor
  • 4293 replies
  • July 25, 2016

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.



AVmcclint
Forum|alt.badge.img+21
  • Esteemed Contributor
  • 1043 replies
  • July 25, 2016

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.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • July 25, 2016

-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.


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