aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifup-post13
1 files changed, 7 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post
index 370ad7e1..64d5d3f0 100755
--- a/sysconfig/network-scripts/ifup-post
+++ b/sysconfig/network-scripts/ifup-post
@@ -99,15 +99,16 @@ fi
# don't set hostname on ppp/slip connections
if [ "$2" = "boot" -a \
- need_hostname -a \
"${DEVICE}" != lo -a \
"${DEVICETYPE}" != "ppp" -a \
"${DEVICETYPE}" != "slip" ]; then
- IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' |
- awk -F: '{ print $2 } ' | awk '{ print $1 }'`
- eval `/bin/ipcalc --silent --hostname ${IPADDR}`
- if [ "$?" = "0" ]; then
- set_hostname $HOSTNAME
+ if need_hostname; then
+ IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' |
+ awk -F: '{ print $2 } ' | awk '{ print $1 }'`
+ eval `/bin/ipcalc --silent --hostname ${IPADDR}`
+ if [ "$?" = "0" ]; then
+ set_hostname $HOSTNAME
+ fi
fi
fi