Posted on 11-23-2015 02:54 PM
I am trying to run the bash script below to uninstall virtualbox on some of our clients. I have parameter 4 as being --unattended but when the script runs it generates an error for the unknown arguments: / <hostname> <user>
http://www.virtualbox.org/svn/vbox/trunk/src/VBox/Installer/darwin/DiskImage/VirtualBox_Uninstall.tool
Is there a way to ignore the first three parameters in the bash script or through the jss console? The script works as expected when I run directly on the client without the first three parameters passed by JAMF (./virtualbox_uninstall.sh --unattended).
Thank you
Posted on 11-23-2015 03:24 PM
I ended up using my_default_prompt="Yes" while commenting out the 'if test..' code block to get past this error and it seems to work with parameter 4: --unattended
Would still be interesting to know whether there is an easy way to prevent the first three parameters from being passed. Something as simple as a checkbox for 'Ignore JSS Parameters' would be nice. Thank you.
Posted on 11-23-2015 03:33 PM
Are you imported the script directly into the JSS or something?
If you are and it is only expecting one parameter then your pretty much going to have to edit the script
Alternatively you could deliver the script to the client machine unaltered (as a dmg for example) and then use another script or commnad line call to launch it locally with the correct parameters.
Posted on 11-23-2015 03:37 PM
Posted on 11-24-2015 04:01 PM
Thank you for the responses. Yes, the script was imported directly into JSS. I am aware JSS will pass the first three parameters automatically. I was trying to figure out how to prevent this instead of just modifying the code which is what @Look suggests as the solution. I would like a way to prevent the JSS from passing the first three parameters but it looks like that is not possible at the moment.
Posted on 02-17-2020 04:48 AM
Is there anything new about this? I can't find anything about this or changing the command which initialises the script. Very frustrating
Posted on 02-17-2020 07:21 AM
Jamf's behavior hasn't changed and I doubt it's likely going to change.
The problem in the case above is with the removal script itself. It simply wasn't written to be copied/pasted into Jamf Pro and run as a Jamf Pro script. It should either be deployed to a Mac as a file and then called using a Policy's Execute Command option under Files & Processes or it should be modified to use one of Jamf's script parameters 4-11.