Verify if the saved hostid is still the same and update if
it was changed. Sponsored by: iXsystems, Inc. Obtained from: FreeNAS (trueos commit 0abb740)
This commit is contained in:
parent
8bf2dccec4
commit
8f990792fc
@ -16,12 +16,19 @@ 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}."
|
||||
current_hostid=`$SYSCTL_N kern.hostuuid`
|
||||
|
||||
if [ -r ${hostid_file} ]; then
|
||||
read saved_hostid < ${hostid_file}
|
||||
if [ ${saved_hostid} = ${current_hostid} ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ${current_hostid} > ${hostid_file}
|
||||
if [ $? -ne 0 ]; then
|
||||
warn "could not store hostuuid in ${hostid_file}."
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
|
Loading…
x
Reference in New Issue
Block a user