KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /etc/rc.d/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //etc/rc.d/hostid_save
#!/bin/sh
#
#

# PROVIDE: hostid_save
# REQUIRE: hostid root
# KEYWORD: nojail

. /etc/rc.subr

name="hostid_save"
desc="Save unique host ID to disk"
start_cmd="hostid_save"
stop_cmd=":"
rcvar="hostid_enable"

hostid_machine_id()
{
	local IFS

	IFS=-
	set -- ${current_hostid}
	IFS=
	current_machine_id=$*
}

hostid_save()
{
	current_hostid=`$SYSCTL_N kern.hostuuid`

	read saved_hostid 2>/dev/null < ${hostid_file}
	if [ "${saved_hostid}" != "${current_hostid}" ]; then
		echo "${current_hostid}" > ${hostid_file} ||
			warn "could not store hostuuid in ${hostid_file}."
	fi

	hostid_machine_id

	read saved_machine_id 2>/dev/null < ${machine_id_file}
	if [ "${saved_machine_id}" != "${current_machine_id}" ]; then
		echo "${current_machine_id}" > ${machine_id_file} ||
			warn "could not store hostuuid in ${machine_id_file}."
	fi
}

load_rc_config $name
run_rc_command "$1"

Anon7 - 2021