#!/usr/sbin/openrc-run

description="Set hostname based on /etc/hostname."

depend()
{
	provide hostname
}

. /lib/init/vars.sh

start()
{
	[ -f /etc/hostname ] || return 0
	HOSTNAME="$(cat /etc/hostname)"

	ebegin "Setting hostname to '$HOSTNAME'"
	hostname "$HOSTNAME"
	eend $?
	return $?
}
