]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - etc/rc.d/hostid_save
MFC r299844,r300931:
[FreeBSD/stable/10.git] / etc / rc.d / hostid_save
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: hostid_save
7 # REQUIRE: hostid root
8 # KEYWORD: nojail
9
10 . /etc/rc.subr
11
12 name="hostid_save"
13 start_cmd="hostid_save"
14 stop_cmd=":"
15 rcvar="hostid_enable"
16
17 hostid_save()
18 {
19         if [ ! -r ${hostid_file} ]; then
20                 $SYSCTL_N kern.hostuuid > ${hostid_file}
21                 if [ $? -ne 0 ]; then
22                         warn "could not store hostuuid in ${hostid_file}."
23                 fi
24         fi
25 }
26
27 load_rc_config $name
28 run_rc_command "$1"