diff options
author | Bill Nottingham <notting@redhat.com> | 2007-02-03 16:56:59 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2007-02-03 16:56:59 +0000 |
commit | 5b9183c7022ff4493484f3746581c3ebfca8dc7a (patch) | |
tree | 5b2e5013e068985d112a47665146f89ecfe85d29 | |
parent | 39ad23179d07a87a6b9019c42c95a17afec15bec (diff) | |
download | initscripts-5b9183c7022ff4493484f3746581c3ebfca8dc7a.tar initscripts-5b9183c7022ff4493484f3746581c3ebfca8dc7a.tar.gz initscripts-5b9183c7022ff4493484f3746581c3ebfca8dc7a.tar.bz2 initscripts-5b9183c7022ff4493484f3746581c3ebfca8dc7a.tar.xz initscripts-5b9183c7022ff4493484f3746581c3ebfca8dc7a.zip |
backport 220318
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 6fc0753f..28880806 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -85,10 +85,9 @@ if [ "$2" = "boot" -a \ "${DEVICETYPE}" != "ppp" -a \ "${DEVICETYPE}" != "slip" ]; then 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 + IPADDR=$(LANG=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 }') + eval $(/bin/ipcalc --silent --hostname ${IPADDR} ; echo "status=$?") + if [ "$status" = "0" ]; then set_hostname $HOSTNAME fi fi |