/[baselayout]/trunk/init.d/hostname
Gentoo

Contents of /trunk/init.d/hostname

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2763 - (show annotations) (download)
Tue Jul 10 19:09:41 2007 UTC (7 years, 1 month ago) by uberlord
File size: 484 byte(s)
init scripts and their extra options can now have descriptions, #184327.
1 #!/sbin/runscript
2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 description="Sets the hostname of the machine."
6
7 depend() {
8 need checkroot
9 }
10
11 start() {
12 if [ -f /etc/hostname ] ; then
13 ewarn "You should stop using /etc/hostname and use /etc/conf.d/hostname"
14 HOSTNAME=$(cat /etc/hostname)
15 fi
16
17 ebegin "Setting hostname to ${HOSTNAME}"
18 hostname "${HOSTNAME}"
19 eend $? "Failed to set the hostname"
20 }
21
22 # vim: set ts=4 :

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20