2007-04-05 16:48:42 +05:30
|
|
|
#!/sbin/runscript
|
2008-01-11 21:01:10 +05:30
|
|
|
# Copyright 2007-2008 Roy Marples <roy@marples.name>
|
|
|
|
# All rights reserved. Released under the 2-clause BSD license.
|
2007-11-14 20:52:04 +05:30
|
|
|
|
2007-07-11 00:39:41 +05:30
|
|
|
description="Sets the hostname of the machine."
|
|
|
|
|
2008-03-03 02:43:21 +05:30
|
|
|
depend() {
|
|
|
|
keyword noprefix
|
|
|
|
}
|
|
|
|
|
2008-01-11 17:43:46 +05:30
|
|
|
start()
|
|
|
|
{
|
2007-11-23 17:34:11 +05:30
|
|
|
hostname=${hostname-${HOSTNAME-localhost}}
|
|
|
|
ebegin "Setting hostname to ${hostname}"
|
|
|
|
hostname "${hostname}"
|
2007-04-05 16:48:42 +05:30
|
|
|
eend $? "Failed to set the hostname"
|
|
|
|
}
|