aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2016-11-10 12:14:30 +0100
committerDee'Kej <deekej@linuxmail.org>2016-11-10 16:38:18 +0100
commite20a9baff26986d2bbb8201615dd39c9748b7141 (patch)
tree3713320dac1be347d8a8065b8ffb93bd57596375 /sysconfig/network-scripts/network-functions
parenteb1a9ae171f8be0137c146b9dfb3906f90d5a8be (diff)
downloadinitscripts-e20a9baff26986d2bbb8201615dd39c9748b7141.tar
initscripts-e20a9baff26986d2bbb8201615dd39c9748b7141.tar.gz
initscripts-e20a9baff26986d2bbb8201615dd39c9748b7141.tar.bz2
initscripts-e20a9baff26986d2bbb8201615dd39c9748b7141.tar.xz
initscripts-e20a9baff26986d2bbb8201615dd39c9748b7141.zip
network-functions: do not send hostname via dhclient everytime
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions17
1 files changed, 10 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 7f753e29..4ff6b988 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -355,13 +355,16 @@ is_available_wait ()
need_hostname ()
{
- CHECK_HOSTNAME=$(hostname)
- if [ "$CHECK_HOSTNAME" = "(none)" -o "$CHECK_HOSTNAME" = "localhost" -o \
- "$CHECK_HOSTNAME" = "localhost.localdomain" ]; then
- return 0
- else
- return 1
- fi
+ CHECK_HOSTNAME="$(hostname)"
+
+ case "$CHECK_HOSTNAME" in
+ '(none)' | 'localhost' | 'localhost.localdomain')
+ return 0
+ ;;
+ *)
+ return 1
+ ;;
+ esac
}
set_hostname ()