summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/hostname
blob: 2a6ffac2bab19273a6bbdf117ab209ebe76ea1a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh /etc/rc.common

start()
{
	local hostname=

	[ -f /etc/hostname ] && hostname="$(cat /etc/hostname)"
	[ -z "${hostname}" ] && hostname="$(hostname)"
	[ -z "${hostname}" ] && hostname='localhost'

	log 'Setting hostname to %s' "${hostname}"
	hostname "${hostname}"
}