#!/bin/sh
#
# common/base-files package pre installation script
#

. ${PKGLIB_SH}

# Check motherboard model, currently only allow Supermicro
if [ -e /etc/platform ]; then
	platform=$( cat /etc/platform )
else
	platform="dcp2000"
fi
#if [ "${platform}" = "dcp2000" ]; then
#	/usr/sbin/dmidecode | grep -qi supermicro
#	if [ $? -ne 0 ] ; then
#		die "Motherboard model is not supported."
#	fi 
#fi 

# Remove old files
rm -f /etc/init.d/cleanlog.sh
rm -f /etc/init.d/bootsequence-check.sh
rm -f /etc/rcS.d/S41bootsequence-check
rm -f /etc/rc2.d/S21doremi-rc.d
rm -f /etc/rc2.d/S01doremi-rc.d
rm -f /etc/rcS.d/S70cleanlog
rm -f /etc/rc0.d/K99zbootsequence-check
rm -f /etc/rc6.d/K99zbootsequence-check
rm -f /doremi/etc/hotplug.d/99_bootsequence-check
rm -f /doremi/etc/rcS.d/02_bootsequence-check

# make sure these symlinks are gone from the goldmaster (ACE #3549)
rm -f /doremi/etc/rcS.d/00_board	&> /dev/null
rm -f /doremi/etc/rcS.d/01_standby	&> /dev/null
rm -f /doremi/etc/rcS.d/20_drmldbd	&> /dev/null
rm -f /doremi/etc/rcS.d/20_sensors	&> /dev/null
rm -f /doremi/etc/rcS.d/20_usbnet	&> /dev/null
rm -f /doremi/etc/rcS.d/11_ledctld	&> /dev/null
rm -f /doremi/etc/rc.d/99_drmstandby	&> /dev/null

rm -f /doremi/opt/dbs/smpte.db	&> /dev/null

# Stop daemon
test -x /etc/init.d/cron && \
	/etc/init.d/cron stop > /dev/null 2>&1

exit 0
