From b9c251beba5b0c7afe64f89caaecaab36b40d573 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 7 Feb 2002 03:56:58 +0000 Subject: fix invocation of need_hostname (#58946) --- sysconfig/network-scripts/ifup-post | 13 +++++++------ 1 file 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 -- cgit v1.2.1