summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/hostid_save
blob: fca0521e8b24ffe898b3a9357665ed2087ddc4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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"
OpenPOWER on IntegriCloud