#!/bin/sh
#
#

# PROVIDE: ix-savehostid
# REQUIRE: FILESYSTEMS

. /etc/rc.subr

#
# Save the hostid file to our persistent store.
#
ix_save_hostid()
{
	# This is a hack to save the hostid.  We should save it in the
	# database, but we don't have an easy way to upgrade people from
	# beta yet, so that will have to wait until after we get that.  For
	# now, just save it so we're the same boot to boot.  We also
	# save it to our "readonly" conf copy rather than the /cfg copy
	# so we don't create another dependency on /cfg which we're trying
	# to eliminate to support 1 spindle systems.
	if ! cmp -s /etc/hostid /conf/base/etc/hostid; then
		cp /etc/hostid /conf/base/etc/hostid
	fi
}

name="ix_savehostid"
start_cmd='ix_save_hostid'
stop_cmd=':'

load_rc_config $name
run_rc_command "$1"
