Advertisement
kdog79

Untitled

Aug 30th, 2014
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. LOGGER="/usr/bin/logger"
  4.  
  5. # Determine working directory
  6. install_dir=`dirname $0`
  7.  
  8. # Uninstall existing copy of Sophos 8.x by checking for the
  9. # Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
  10. # If present, the uninstallation process is run.
  11.  
  12. if [ -d /Library/Sophos\ Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg ]; then
  13.         ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
  14.         /usr/sbin/installer -pkg /Library/Sophos Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg -target /
  15. elif [ -d /Library/Application\ Support/Sophos Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg ]; then
  16.         ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
  17.         /usr/sbin/installer -pkg /Library/Application\ Support/Sophos\ Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg -target /
  18. else
  19.         ${LOGGER} "Sophos Anti-Virus 8.x Uninstaller Not Present"
  20. fi
  21.  
  22. # Uninstall existing copy of Sophos 9.x by checking for the InstallationDeployer application
  23. # in /Library/Application Support/Sophos/he/Installer.app/Contents/MacOS. If present, the
  24. # uninstallation process is run.
  25.  
  26.  
  27. # Uninstall SAV Home Edition if it exists
  28. if [ -f /Library/Application\ Support/Sophos/he/Installer.app/Contents/MacOS/InstallationDeployer ]; then
  29.         /Library/Application\ Support/Sophos/he/Installer.app/Contents/MacOS/InstallationDeployer --remove
  30. ${LOGGER} "Sophos AV Home Edition present on Mac. Uninstalling before installing new copy."
  31. fi
  32.  
  33.  
  34. # Uninstall the different SAV Stand alone versions if they exist
  35. if [ -f /Library/Application\ Support/Sophos/opm-sa/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
  36.         /Library/Application\ Support/Sophos/opm-sa/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
  37. ${LOGGER} "Sophos AV Stand alone present on Mac. Uninstalling before installing new copy."
  38. elif [ -f /Library/Application\ Support/Sophos/opm-sa-installer/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
  39.         /Library/Application\ Support/Sophos/opm-sa-installer/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
  40. ${LOGGER} "Sophos AV Stand alone present on Mac. Uninstalling before installing new copy."
  41. fi
  42.  
  43.  
  44. # Uninstall the SAV Enterprise version if it exists
  45. if [ -f /Library/Application\ Support/Sophos/opm/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
  46. /Library/Application\ Support/Sophos/opm/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
  47. ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
  48. fi
  49.  
  50.  
  51. # Install Sophos Anti-Virus 9.x
  52. if [ -e $install_dir/"Sophos Anti-Virus Home Edition.app/Contents/MacOS/InstallationDeployer" ]; then
  53.         ${LOGGER} "Installing Sophos Anti-Virus Home Edition"
  54.         $install_dir/"Sophos Anti-Virus Home Edition.app/Contents/MacOS/InstallationDeployer" --install
  55. else
  56.         if [ -e $install_dir/Sophos\ Installer.app/Contents/MacOS/InstallationDeployer ]; then
  57.                 ${LOGGER} "Installing Sophos Anti-Virus 9"
  58.                 $install_dir/Sophos\ Installer.app/Contents/MacOS/InstallationDeployer --install
  59.         fi
  60. fi
  61.  
  62. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement