aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-04-18 14:16:08 -0400
committerBill Nottingham <notting@redhat.com>2011-04-18 14:16:08 -0400
commit3c38f904f831f02d5f5c28f431ca86d9877697f1 (patch)
tree98e456d2c3979d7239c5307d51a6c6beb59c705f /rc.d
parentb4bdede8b55b39467ee96da8d4e72dadd4e269ba (diff)
downloadinitscripts-3c38f904f831f02d5f5c28f431ca86d9877697f1.tar
initscripts-3c38f904f831f02d5f5c28f431ca86d9877697f1.tar.gz
initscripts-3c38f904f831f02d5f5c28f431ca86d9877697f1.tar.bz2
initscripts-3c38f904f831f02d5f5c28f431ca86d9877697f1.tar.xz
initscripts-3c38f904f831f02d5f5c28f431ca86d9877697f1.zip
Support overriding hostname via /etc/hostname.
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit3
1 files changed, 3 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 6067ea88..561e99e8 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -12,6 +12,9 @@ set -m
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
fi
+if [ -r /etc/hostname ]; then
+ HOSTNAME=$(cat /etc/hostname)
+fi
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
HOSTNAME=localhost
fi