#!/bin/sh
#
# setup	Perform OEM Setup
#
# chkconfig: - 32 90
# description:	Perform one-time OEM Setup upon first boot

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

RETVAL=0

start()
{
	grep -q systemd.unit=setup.target /proc/cmdline || return 0
	export ALTERATOR_SETUP_STEPS=/etc/alterator-setup/steps
	service plymouth stop 2>/dev/null
	service alteratord start
	alterator-setup-prep
	alterator-setup-run
	RETVAL=$?
	return $RETVAL ###
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop|reload|restart|condstop|condrestart|condreload)
		;;
	status)
		status --expect-user root -- alterator-setup-run ###
		RETVAL=$?
		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL
