diff options
author | Erik Troan <ewt@redhat.com> | 1998-03-10 15:51:16 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1998-03-10 15:51:16 +0000 |
commit | 54a18ea25de3965e7ae907c3238569eb01803bf1 (patch) | |
tree | f7406baec5ce06d0a15382b0504c860256721fc7 /sysconfig/network-scripts/network-functions | |
parent | fb0f2343a9f5f284e7b75adf60fa33f50181b3fb (diff) | |
download | initscripts-54a18ea25de3965e7ae907c3238569eb01803bf1.tar initscripts-54a18ea25de3965e7ae907c3238569eb01803bf1.tar.gz initscripts-54a18ea25de3965e7ae907c3238569eb01803bf1.tar.bz2 initscripts-54a18ea25de3965e7ae907c3238569eb01803bf1.tar.xz initscripts-54a18ea25de3965e7ae907c3238569eb01803bf1.zip |
1) added need_hostname and set_hostname functions
2) changed hostname lookup to use ipcalc
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r-- | sysconfig/network-scripts/network-functions | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index ca202407..2578ac46 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -28,3 +28,19 @@ do_netreport () done ) } + +need_hostname() +{ + if [ "`hostname`" = "(none)" -o "`hostname`" = "localhost" -o + "`hostname`" = "localhost.localdomain" ]; then + NEEDHOSTNAME=yes + else + unset NEEDHOSTNAME + fi +} + +set_hostname() +{ + echo "$1" > /etc/HOSTNAME + hostname $1 +} |