1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00
freebsd/etc/rc.d/hostid_save

29 lines
404 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: hostid_save
# REQUIRE: root
# 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"