Running Uninstall Script via Policy, Errors Out

bsanto
New Contributor II

Hey everyone.

Trying to run this complicated Symantec Removal script so we can get Symantec off and everyone moved to Trend Micro. I have a script Symantec provided me that does a great job of clearing everything out in one go.

When I run it as a policy I get an error right away, here's the log from Casper Remote:

Sending Wake On LAN command...
Opening SSH Connection to 10.51.29.33...
Authenticating...
Successfully authenticated.
Verifying Computer's Identity...
The MAC Address has been verified.
Checking Operating System Version...
Running Mac OS X 10.12.1 (16B2555)
Verifying /usr/local/jamf/bin/jamf...
/usr/local/jamf/bin/jamf is current (9.8)
Verifying /usr/sbin/jamf...
/usr/sbin/jamf does not exist.
Verifying /Library/Preferences/com.jamfsoftware.jamf.plist...
Preparing Policy...
Executing Policy 2016-11-15 at 4:45 PM | bsanto | 1 Computer...
Running script RemoveSymantecMacFiles.sh...
Script exit code: 4
Script result:
ERROR: Invalid option or volume name: "mac2144".
Usage: RemoveSymantecMacFiles.sh [-CcdeFfghIikLlmpQqRrV] [-QQ] [-re] [volume ...]
Submitting log to https://casper.entrata.com:8443/
Finished.

(Yes, I know, we're running 9.8. Working on getting that upgraded with the infrastructure team.)

Here's a copy of the script I'm trying to run: https://drive.google.com/file/d/0B6J5SDBrFVJqTTR3V01ZLXI1WmM/view?usp=sharing

Any help would be much appreciated. I think I might have to pass some parameters to it, but I'm not sure. Never had to use that feature before.

Thanks!

4 REPLIES 4

rquigley
Contributor

Hi,

Outside of your JSS not being up to date, which could be a cause of the issue.

The script is stating it's unable to find a volume name called "mac2144". The script indeed does have parameters which means you won't be able to push it to a machine in a conventional sense.

You may need to place the script into the machine using a dmg into a hidden directory, then run another script to call this one with the appropriate parameters.

Symantec's official documentation states that a .command file needs to be run, since it may have menus that the user needs to navigate, it might be worth exploring this. https://support.symantec.com/en_US/article.tech103489.html

bsanto
New Contributor II

Thank you rquigely for the response.

The file I'm using is their .command file, but I have renamed it to .sh to be compatible with Jamf Pro script execution. It is a .sh script at heart, so it should still run with the .sh designation (I tested it locally on another machine and the script still ran.)

All our volumes are called Macintosh HD (unless the user has changed it). Is there any way to pass a variable (in this case, the local root volume's name) to the script using script parameter values?

bsanto
New Contributor II

So, I wonder if somehow the script is being passed $2 (computer name) straight from casper, instead of $1 (mount point)?

Or maybe I just need to place the script into a hidden directory and run another script like rquigley said that calls the proper parameters.

sdunbar
Contributor

Hi
I am having the same issue, with the error:
Script result: ERROR: Invalid option or volume name: "sdunbar".

bsanto - Symantec have the following on their website: Remote deployment solutions (Casper, JAMF, et al) that automatocally populate shell script arguments ($1, $2, etc) with other data may cause the Symantec tool to throw an error. To work around this, the remote deployment solution may be configured to call first a dummy script that in turn calls the removal tool without any extra arguments.

rquigley - If this needs to be called by another script with the appropriate parameters what might they be.

Being very new to all this any help would be greatly appreciated