Help Deleting a File

markbgomez
New Contributor

Need to delete an application and then reinstall a newer version. Tried a script:

#!/bin/bash

rm -rf /Applications/PCClient.app

It didn't work. Tried to execute it as a command. Issued it over Self Service and couldn't get it to work on my laptop.

If it matters, we're running our JSS on a Windows server.

4 REPLIES 4

bpavlov
Honored Contributor

Is the script executable?

If you do the following in Terminal:
ls -la /path/to/script.sh

What do you get?

bentoms
Release Candidate Programs Tester

@markbgomez, did you deploy the app via a DMG?

If so, you in Casper Admin... Index the DMG & then tick "Allow this dmg to be uninstalled via policy or remote"

Then create a policy or script that removes the old version & installs the new.

Even if it wasn't deployed via a DMG, you could create one of the old app & do the above.

markbgomez
New Contributor

Thanks. I'll test both of those on Monday. The app wasn't deployed by DMG, but I could try creating one.

davidacland
Honored Contributor II

Hi, if its just a one-liner I would add it straight into the policy, rather than running a separate script. The syntax all looks fine to me and it should be running as root if its via Casper.

I would look at the policy logs as that would normally tell you the error / reason why (e.g. no such file or directory, permission denied etc).