aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysconfig/network-scripts/network-functions8
-rwxr-xr-xsystemd/rhel-readonly4
2 files changed, 9 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index d3b24eee..850cc3ff 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -7,6 +7,10 @@
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
+# We need to initialize the $HOSTNAME variable by ourselves now:
+# (It was previously done for RHEL-6 branch, but got lost in time.)
+HOSTNAME="$(hostname)"
+
[ -z "$__sed_discard_ignored_files" ] && . /etc/init.d/functions
get_hwaddr ()
@@ -367,9 +371,7 @@ is_available_wait ()
is_hostname_set ()
{
- CHECK_HOSTNAME="$(hostname)"
-
- case "$CHECK_HOSTNAME" in
+ case "${HOSTNAME}" in
'(none)' | 'localhost' | 'localhost.localdomain')
# Hostname NOT set:
return 1
diff --git a/systemd/rhel-readonly b/systemd/rhel-readonly
index 50e5ed97..83b1747b 100755
--- a/systemd/rhel-readonly
+++ b/systemd/rhel-readonly
@@ -5,6 +5,10 @@
. /etc/init.d/functions
+# We need to initialize the $HOSTNAME variable by ourselves now:
+# (It was previously done for RHEL-6 branch, but got lost in time.)
+HOSTNAME="$(hostname)"
+
# Check SELinux status
SELINUX_STATE=
if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then