2008-03-02 21:14:01 +00:00
|
|
|
#!@PREFIX@/sbin/runscript
|
2009-05-01 15:11:40 +01:00
|
|
|
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
2011-06-29 19:46:31 -04:00
|
|
|
# Released under the 2-clause BSD license.
|
2007-11-14 15:22:04 +00:00
|
|
|
|
2007-07-10 19:09:41 +00:00
|
|
|
description="Sets the hostname of the machine."
|
|
|
|
|
2008-03-02 21:13:21 +00:00
|
|
|
depend() {
|
2011-06-02 16:06:27 +02:00
|
|
|
keyword -prefix -lxc
|
2008-03-02 21:13:21 +00:00
|
|
|
}
|
|
|
|
|
2008-01-11 12:13:46 +00:00
|
|
|
start()
|
|
|
|
{
|
2007-11-23 12:04:11 +00:00
|
|
|
hostname=${hostname-${HOSTNAME-localhost}}
|
2009-04-27 07:51:18 +00:00
|
|
|
ebegin "Setting hostname to $hostname"
|
|
|
|
hostname "$hostname"
|
2007-04-05 11:18:42 +00:00
|
|
|
eend $? "Failed to set the hostname"
|
|
|
|
}
|