#!/bin/sh
if [ "$1" != nocheck ]; then
if [ `whoami` != root ]; then
echo "$0 must be run as root, use \"sudo $0\""
exit 1
fi
fi
echo "Are you sure you want to uninstall AVR MacPack 20081213?"
echo "[y/N]"
read answer
if echo "$answer" | egrep -i 'y|yes' >/dev/null; then
echo "Starting uninstall."
if cd "/usr/local/AVRMacPack-20081213/.."; then
rm -f "AVRMacPack"
fi
rm -rf "/usr/local/AVRMacPack-20081213"
rm -f "/Applications/AVRMacPack-Manual.html"
rm -rf "/Library/Receipts/AVRMacPack.pkg"
echo "AVR MacPack is now removed."
else
echo "Uninstall aborted."
fi
