#!/bin/sh # We need to be root to run this script user=`whoami` if [ "$user" != "root" ];then echo "You must authenticate as root to uninstall AppleJack. Please enter your admin password." sudo $0 # call this script with sudo exit fi AJ='/private/var/root/Library/Scripts/applejack.sh' rootProfile='/private/var/root/.profile' manPage='/usr/share/man/man8/applejack.8' tmp='/private/tmp/applejack.install' if [ -e "$AJ" ];then echo "found AppleJack script. Removing..." rm -fv /private/var/root/Library/Scripts/applejack.sh echo "" fi echo "Searching for and removing any AppleJack man caches..." find /usr/share/man -name 'applejack.*.gz' -exec rm -v {} \; echo "Done." echo "Restoring the root profile..." sed -e '/[aA]pple[jJ]ack/d' "$rootProfile" > "$tmp" rm -f "$rootProfile" mv "$tmp" "$rootProfile"; echo "Done." echo "Searching for and removing AppleJack man pages..." find /usr -type f \( -name 'applejack.8' -o -name 'applejack.1' \) -exec rm -fv {} \; echo "done." echo "AppleJack is uninstalled." exit 0