#! /bin/sh
VERSION=v3.35
MPLABDIR=/opt/microchip/mplabx/${VERSION}/mplab_ide
OLDEXEC=${MPLABDIR}/bin/mplab_ide.orig
NEWEXEC=/csciloc/ubuntu/Images/UNCACSCI-mplab_ide
EXECLOC=${MPLABDIR}/bin/mplab_ide
echo "fix mplab_ide ${VERSION}"
if [ ! -d "${MPLABDIR}" ]; then
    echo "Can't find ${MPLABDIR}"
    exit 1
fi
if [ -f "${OLDEXEC}" ]; then
    echo "Change already made. ${OLDEXEC} exists"
    exit 1
fi
mv "${EXECLOC}" "${OLDEXEC}"
cp "${NEWEXEC}" "${EXECLOC}"
