aboutsummaryrefslogtreecommitdiff
path: root/init.d/hostname
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-23 12:04:11 +0000
committerRoy Marples <roy@marples.name>2007-11-23 12:04:11 +0000
commitd81def80b00a3dbcb4f8980f4503c4d659b48a2a (patch)
tree64a5df4281620cacbc1f03838d42e88167886fc9 /init.d/hostname
parentf077f179edaeb746b267421baa29ec751c38b713 (diff)
Move /etc/conf.d/rc to /etc/rc.conf.
Lowercase all configurable variables, non configurations remain uppercase. Replace rc_env_bool with rc_yesno. Split localmount info procfs (Linux) and dumpon, savecore (BSD)
Diffstat (limited to 'init.d/hostname')
-rwxr-xr-xinit.d/hostname10
1 files changed, 3 insertions, 7 deletions
diff --git a/init.d/hostname b/init.d/hostname
index 3f6b0569..688c0421 100755
--- a/init.d/hostname
+++ b/init.d/hostname
@@ -31,13 +31,9 @@ depend() {
}
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}"
+ hostname=${hostname-${HOSTNAME-localhost}}
+ ebegin "Setting hostname to ${hostname}"
+ hostname "${hostname}"
eend $? "Failed to set the hostname"
}