]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/hostid_save
Update compiler-rt to 3.7.0 release. This also includes the sanitizer
[FreeBSD/FreeBSD.git] / etc / rc.d / hostid_save
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: hostid_save
7 # REQUIRE: 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         current_hostid=`$SYSCTL_N kern.hostuuid`
20
21         if [ -r ${hostid_file} ]; then
22                 read saved_hostid < ${hostid_file}
23                 if [ ${saved_hostid} = ${current_hostid} ]; then
24                         exit 0
25                 fi
26         fi
27
28         echo ${current_hostid} > ${hostid_file}
29         if [ $? -ne 0 ]; then
30                 warn "could not store hostuuid in ${hostid_file}."
31         fi
32 }
33
34 load_rc_config $name
35 run_rc_command "$1"