diff options
author | Bill Nottingham <notting@redhat.com> | 2000-01-31 22:51:25 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2000-01-31 22:51:25 +0000 |
commit | 981c894294639ca3d7ae09b7e20f9e2b6c893a96 (patch) | |
tree | a517e4e1b9f4e6001222227b894c1024fe4507a7 | |
parent | a84618ee572933ecd2958963a4e1e3ff1fc41082 (diff) | |
download | initscripts-981c894294639ca3d7ae09b7e20f9e2b6c893a96.tar initscripts-981c894294639ca3d7ae09b7e20f9e2b6c893a96.tar.gz initscripts-981c894294639ca3d7ae09b7e20f9e2b6c893a96.tar.bz2 initscripts-981c894294639ca3d7ae09b7e20f9e2b6c893a96.tar.xz initscripts-981c894294639ca3d7ae09b7e20f9e2b6c893a96.zip |
set hostname only on boot
-rwxr-xr-x | sysconfig/network-scripts/ifup | 2 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 116a4e5f..6b1262c7 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -142,4 +142,4 @@ if [ "$IPX" = yes ]; then /etc/sysconfig/network-scripts/ifup-ipx $DEVICE fi -exec /etc/sysconfig/network-scripts/ifup-post $CONFIG +exec /etc/sysconfig/network-scripts/ifup-post $CONFIG $2 diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index a56860e8..6bce2aa1 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -22,7 +22,7 @@ fi /etc/sysconfig/network-scripts/ifup-routes ${DEVICE} # don't set hostname on ppp/slip connections -if [ -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then +if [ "$2" = "boot" -a -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then IPADDR=`ifconfig ${DEVICE} | grep 'inet addr' | awk -F: '{ print $2 } ' | awk '{ print $1 }'` eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME |