From 981c894294639ca3d7ae09b7e20f9e2b6c893a96 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 31 Jan 2000 22:51:25 +0000 Subject: set hostname only on boot --- sysconfig/network-scripts/ifup-post | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysconfig/network-scripts/ifup-post') 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 -- cgit v1.2.1