diff options
author | Bill Nottingham <notting@redhat.com> | 2001-04-02 21:03:06 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2001-04-02 21:03:06 +0000 |
commit | 81bb56a238b09edfe21c757e2cbe77a5fa32a273 (patch) | |
tree | 51e05ea4df5c68d8eb7deb6043e7e3ee8967408b /sysconfig/network-scripts/ifup-post | |
parent | 9a1806d7b052ec6b4f1bd151c288cbeb99380a35 (diff) | |
download | initscripts-81bb56a238b09edfe21c757e2cbe77a5fa32a273.tar initscripts-81bb56a238b09edfe21c757e2cbe77a5fa32a273.tar.gz initscripts-81bb56a238b09edfe21c757e2cbe77a5fa32a273.tar.bz2 initscripts-81bb56a238b09edfe21c757e2cbe77a5fa32a273.tar.xz initscripts-81bb56a238b09edfe21c757e2cbe77a5fa32a273.zip |
fix scoping isuse (#22547)
fix more ifconfig greps (patch from Conectiva)
Diffstat (limited to 'sysconfig/network-scripts/ifup-post')
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index e0517ec0..d99b2111 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -23,9 +23,12 @@ fi # don't set hostname on ppp/slip connections if [ "$2" = "boot" -a -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then - IPADDR=`ifconfig ${DEVICE} | grep 'inet addr' | + IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' | awk -F: '{ print $2 } ' | awk '{ print $1 }'` - eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME + eval `/bin/ipcalc --silent --hostname ${IPADDR}` + if [ "$?" = "0" ]; then + set_hostname $HOSTNAME + fi fi if [ "$PEERDNS" != "no" -o -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then |