Invalid script format error when I drag a bash shell script into Casper Admin

stevenjklein
Contributor II

I have a shell script that works fine when I execute it from the command line. (I tested it on 3 different Macs.)

But when I try and drag it into Casper Admin, I get 3e507a2163df4d068bee24a57c2ea459

It's a very big script (a little over 6MB), but I've uploaded similar large scripts before.

I'm sure I could work around it (using composer to package it up, and a policy to copy it to the Mac and execute it), but I don't want to do all that extra work. (If I liked doing things manually, I wouldn't be using Jamf!)

I looked for, but could not find any documentation regarding a maximum script size.

I do know from previous experience that the jss web page chokes when I try and past in a script that large, so I really need to use casper admin.

5 REPLIES 5

mm2270
Legendary Contributor III

You say you can't copy/paste the script into a new script window in the JSS UI? I don't think I've ever run into a problem creating a script in the UI like that, but then again I've never tried with a 6 mb script. Just curious, but I'm wondering what would make the script so large? Are you containing a full package inside it in base64 format perhaps? Even my largest scripts that can be thousands of lines long never get bigger than a few hundred KB on disk, maybe about 600 kb max.

Is it possible to copy/paste it in in sections maybe, rather than all at once?

Edit: Erm, never mind. I obviously wasn't reading before. You said in multiple places that it's a bash script, not an AppleScript. Still curious about what is making it so large though.

stevenjklein
Contributor II
I'm wondering what would make the script so large? Are you containing a full package inside it in base64 format perhaps?

I sure didn't write this monster of a script. It's generated by our McAfee ePO. And you're on the right track with your speculation about base64. Only it's a disk image, not a package. It's about 300 lines of code, followed by about 24000 lines of an ASCII-encoded binary.

I just tried (again) to upload it by pasting it into the JSS web interface. Here's what happens when I click Save:
1. A status bar that appears in the lower-left shows Uploading (10%)…
2. It counts up to some high number (like 97%), then dies
3. After a delay, I see Processing request…
4. After another delay, I see this: Please excuse the inconvenience. It appears your request has timed out. Try again shortly.

If I don't find a fix, I'll probably just end going the package route, but it would be nice if JSS did what it's supposed to do.

mm2270
Legendary Contributor III

Ah, yes, McAfee. I had a feeling it was McAfee.

Do you have a direct channel to anyone at McAfee? Or is there a security division in the org that handles this stuff? I ask because they should be able to supply you with a real installer package and not that ridiculous wonky embedded dmg in a script nonsense that McAfee puts together. Why they continue to use this stupid process is beyond me, but then again, most of what McAfee does defies comprehension.

All I know is we always use a package and not that crazy monster script. That script was really not designed for enterprise deployment.

stevenjklein
Contributor II

Thanks, @mm2270, for suggesting tracking down the installer package.

I'd looked before, but our McAfee guy only gave me the script and the "smartinstaller" app (which can only be run interactively, so there's no way to deploy it with Jamf).

So I went back and pushed for a little more help. He just gave me access to a folder full of McAffee stuff. Lo and behold it contains a file called MFEma.dmg. When mounted, that dmg contains ma.pkg, which is the McAfee Agent installer package! Yay!

I haven't tested it yet, but I'm hoping that will solve the problem for me.

tkersting
New Contributor II

The way I install the McAfee agent is by using composer to create a package that copies that script over to the Mac and pushing out that package via a policy. In the same policy under "files and processes" you can execute the script that will install the agent.

https://www.jamf.com/jamf-nation/articles/182/deploying-the-mcafee-epo-agent-using-the-casper-suite