Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 2b6d57de11205d1e4ec8b18312057c35 > files > 226

initng-ifiles-0.1.5-4.fc12.i686.rpm

#!/sbin/itype
# This is a i file, used by initng parsed by install_service

# NAME: hostname
# DESCRIPTION: Sets the system hostname

service system/hostname {
	need = system/initial;
	env HOSTNAME=localhost;
	env_file = /etc/sysconfig/network;
	script start = {
		# If the hostname is already set via the kernel, and
		# /etc/hostname isn't setup, then we shouldn't go reseting the
		# configuration #38172.
		if [ "${HOSTNAME}" ]
		then
			/bin/true
		elif [ -f /etc/hostname ]
		then
			HOSTNAME=$(/bin/cat /etc/hostname)
		elif host=$(/bin/hostname)
			[ -z "${host}" -o "${host}" = '(none)' ]
		then
			HOSTNAME=${host}
		else
			HOSTNAME='localhost'
		fi

		exec /bin/hostname "${HOSTNAME}"
	};
}