#!/bin/bash

arch=$(uname -p)
/usr/sbin/usermod -s /bin/hmcbash hscroot 2>/dev/null
if [ $? -ne 0 ]; then
    echo "Unable to change hscroot shell"
    exit 1
fi
sed -i '/^hscroot/d' /etc/sudoers
if [ $? -ne 0 ]; then
    echo "unable to remove hscroot from /etc/sudoers"
    exit 1
fi
rm /usr/hmcrbin/sudo
if [ "$arch" = "x86_64" ]; then
    /bin/rm -f /opt/hsc/data/.ssh_enabled
    /bin/rm -f /etc/systemd/system/mfgaccess.service

    /bin/rm -f /root/linuxmig
    /bin/rm -f /root/mk288.cmd
    /bin/rm -f /root/mk2882.cmd
    /bin/rm -f /root/newpkg.tgz
    /bin/rm -f /root/HmcShip
    /bin/rm -f /root/enableRemoteAccess
    /bin/rm -f /opt/ccfw/data/FirewallSettings.eth*
fi

/opt/hsc/bin/cleanupHMC
