openrc/init.d/hostname.in
William Hubbs e641b43849 Bring Back prefix support
We now have a team member who is interested in OpenRC on prefix, so I am
bringing it back to the main tree.
2012-07-26 10:54:48 -05:00

18 lines
368 B
Plaintext

#!@PREFIX@/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Sets the hostname of the machine."
depend() {
keyword -prefix -lxc
}
start()
{
hostname=${hostname-${HOSTNAME-localhost}}
ebegin "Setting hostname to $hostname"
hostname "$hostname"
eend $? "Failed to set the hostname"
}