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