Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- LOGGER="/usr/bin/logger"
- # Determine working directory
- install_dir=`dirname $0`
- # Uninstall existing copy of Sophos 8.x by checking for the
- # Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
- # If present, the uninstallation process is run.
- if [ -d /Library/Sophos\ Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg ]; then
- ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
- /usr/sbin/installer -pkg /Library/Sophos Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg -target /
- elif [ -d /Library/Application\ Support/Sophos Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg ]; then
- ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
- /usr/sbin/installer -pkg /Library/Application\ Support/Sophos\ Anti-Virus/Remove\ Sophos\ Anti-Virus.pkg -target /
- else
- ${LOGGER} "Sophos Anti-Virus 8.x Uninstaller Not Present"
- fi
- # Uninstall existing copy of Sophos 9.x by checking for the InstallationDeployer application
- # in /Library/Application Support/Sophos/he/Installer.app/Contents/MacOS. If present, the
- # uninstallation process is run.
- # Uninstall SAV Home Edition if it exists
- if [ -f /Library/Application\ Support/Sophos/he/Installer.app/Contents/MacOS/InstallationDeployer ]; then
- /Library/Application\ Support/Sophos/he/Installer.app/Contents/MacOS/InstallationDeployer --remove
- ${LOGGER} "Sophos AV Home Edition present on Mac. Uninstalling before installing new copy."
- fi
- # Uninstall the different SAV Stand alone versions if they exist
- if [ -f /Library/Application\ Support/Sophos/opm-sa/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
- /Library/Application\ Support/Sophos/opm-sa/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
- ${LOGGER} "Sophos AV Stand alone present on Mac. Uninstalling before installing new copy."
- elif [ -f /Library/Application\ Support/Sophos/opm-sa-installer/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
- /Library/Application\ Support/Sophos/opm-sa-installer/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
- ${LOGGER} "Sophos AV Stand alone present on Mac. Uninstalling before installing new copy."
- fi
- # Uninstall the SAV Enterprise version if it exists
- if [ -f /Library/Application\ Support/Sophos/opm/Installer.app/Contents/MacOS/tools/InstallationDeployer ]; then
- /Library/Application\ Support/Sophos/opm/Installer.app/Contents/MacOS/tools/InstallationDeployer --remove
- ${LOGGER} "Sophos AV present on Mac. Uninstalling before installing new copy."
- fi
- # Install Sophos Anti-Virus 9.x
- if [ -e $install_dir/"Sophos Anti-Virus Home Edition.app/Contents/MacOS/InstallationDeployer" ]; then
- ${LOGGER} "Installing Sophos Anti-Virus Home Edition"
- $install_dir/"Sophos Anti-Virus Home Edition.app/Contents/MacOS/InstallationDeployer" --install
- else
- if [ -e $install_dir/Sophos\ Installer.app/Contents/MacOS/InstallationDeployer ]; then
- ${LOGGER} "Installing Sophos Anti-Virus 9"
- $install_dir/Sophos\ Installer.app/Contents/MacOS/InstallationDeployer --install
- fi
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement