Skip to main content
Question

Help Deleting a File

  • February 6, 2015
  • 4 replies
  • 5 views

Forum|alt.badge.img+2

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

bpavlov
Forum|alt.badge.img+18
  • Esteemed Contributor
  • February 7, 2015

Is the script executable?

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

What do you get?


bentoms
Forum|alt.badge.img+35
  • Hall of Fame
  • February 7, 2015

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


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • February 8, 2015

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


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • February 8, 2015

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