30-hostname revision e95877ecfa1170d77b1ec1f66752725cdda01b64
1# Set the hostname from DHCP data if required
2
3need_hostname()
4{
5	case "$(hostname)" in
6		""|"(none)"|localhost)	[ -n "${new_host_name}" ];;
7		"${old_host_name}") 	true;;
8		*) 			false;;
9	esac
10}
11
12set_hostname()
13{
14	if need_hostname; then
15		hostname "${new_host_name}"
16	fi
17}
18
19case "${reason}" in
20BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT)	set_hostname;;
21esac
22