2007-04-05 16:48:42 +05:30
|
|
|
#!/sbin/runscript
|
|
|
|
# Copyright 1999-2007 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2007-07-11 00:39:41 +05:30
|
|
|
description="Sets the hostname of the machine."
|
|
|
|
|
2007-04-05 16:48:42 +05:30
|
|
|
depend() {
|
|
|
|
need checkroot
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
if [ -f /etc/hostname ] ; then
|
|
|
|
ewarn "You should stop using /etc/hostname and use /etc/conf.d/hostname"
|
|
|
|
HOSTNAME=$(cat /etc/hostname)
|
|
|
|
fi
|
|
|
|
|
|
|
|
ebegin "Setting hostname to ${HOSTNAME}"
|
|
|
|
hostname "${HOSTNAME}"
|
|
|
|
eend $? "Failed to set the hostname"
|
|
|
|
}
|
|
|
|
|
2007-05-11 16:03:49 +05:30
|
|
|
# vim: set ts=4 :
|