freebsd-nq/etc/rc.d/hostid_save

30 lines
429 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: hostid_save
# REQUIRE: root
# BEFORE: mountcritlocal
# KEYWORD: nojail
. /etc/rc.subr
name="hostid_save"
start_cmd="hostid_save"
stop_cmd=":"
rcvar="hostid_enable"
hostid_save()
{
if [ ! -r ${hostid_file} ]; then
$SYSCTL_N kern.hostuuid > ${hostid_file}
if [ $? -ne 0 ]; then
warn "could not store hostuuid in ${hostid_file}."
fi
fi
}
load_rc_config $name
run_rc_command "$1"