aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-eth
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-04-15 16:30:41 +0000
committerBill Nottingham <notting@redhat.com>2005-04-15 16:30:41 +0000
commit49660b9ccb2247f9d413927c4c72de3b74aa2baa (patch)
treeeda91480f8ad89aee6074f979007d5eb0f366108 /sysconfig/network-scripts/ifup-eth
parent1c3d4f9191484c0c65d5a3854e29dd72fb7e4117 (diff)
downloadinitscripts-49660b9ccb2247f9d413927c4c72de3b74aa2baa.tar
initscripts-49660b9ccb2247f9d413927c4c72de3b74aa2baa.tar.gz
initscripts-49660b9ccb2247f9d413927c4c72de3b74aa2baa.tar.bz2
initscripts-49660b9ccb2247f9d413927c4c72de3b74aa2baa.tar.xz
initscripts-49660b9ccb2247f9d413927c4c72de3b74aa2baa.zip
more dhclient-only cleanups
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth30
1 files changed, 14 insertions, 16 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index f436b5b8..ea89e64d 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -128,14 +128,14 @@ if [ -n "${MTU}" ]; then
ip link set dev ${DEVICE} mtu ${MTU}
fi
-# Remove any temporary references which were previously added to dhclient config
-if [ -w /etc/dhclient-${DEVICE}.conf ] && [ -x /sbin/dhclient ] ; then
- LC_ALL=C grep -v "# temporary RHL ifup addition" /etc/dhclient-${DEVICE}.conf > /etc/dhclient-${DEVICE}.conf.ifupnew 2> /dev/null
- cat /etc/dhclient-${DEVICE}.conf.ifupnew > /etc/dhclient-${DEVICE}.conf
- rm -f /etc/dhclient-${DEVICE}.conf.ifupnew
-fi
-if [ -n "${DYNCONFIG}" ]; then
+if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then
+ # Remove any temporary references which were previously added to dhclient config
+ if [ -w /etc/dhclient-${DEVICE}.conf ] ; then
+ LC_ALL=C grep -v "# temporary RHL ifup addition" /etc/dhclient-${DEVICE}.conf > /etc/dhclient-${DEVICE}.conf.ifupnew 2> /dev/null
+ cat /etc/dhclient-${DEVICE}.conf.ifupnew > /etc/dhclient-${DEVICE}.conf
+ rm -f /etc/dhclient-${DEVICE}.conf.ifupnew
+ fi
if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then
ONESHOT="";
else
@@ -143,14 +143,12 @@ if [ -n "${DYNCONFIG}" ]; then
fi;
if [ -n "${DHCP_HOSTNAME}" ]; then
# Send a host-name to the DHCP server (requ. by some dhcp servers).
- if [ -x /sbin/dhclient ] ; then
- if [ -w /etc/dhclient-${DEVICE}.conf ] ; then
- if ! LC_ALL=C grep "send *host-name *\"${DHCP_HOSTNAME}\"" /etc/dhclient-${DEVICE}.conf > /dev/null 2>&1 ; then
- echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf
- fi
- elif ! [ -e /etc/dhclient-${DEVICE}.conf ] ; then
- echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf
- fi
+ if [ -w /etc/dhclient-${DEVICE}.conf ] ; then
+ if ! LC_ALL=C grep "send *host-name *\"${DHCP_HOSTNAME}\"" /etc/dhclient-${DEVICE}.conf > /dev/null 2>&1 ; then
+ echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf
+ fi
+ elif ! [ -e /etc/dhclient-${DEVICE}.conf ] ; then
+ echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf
fi
fi
# allow users to use generic '/etc/dhclient.conf' (as documented in manpage!)
@@ -173,7 +171,7 @@ if [ -n "${DYNCONFIG}" ]; then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
- if [ -x /sbin/dhclient ] && /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
+ if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then
echo $" done."
else
echo $" failed."