From 265989c6fce9523b46aa9020f241ab2450307aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 19 Dec 2009 15:57:03 +0200 Subject: Eliminate bunch of unnecessary stat calls and command invocations. --- sysconfig/network-scripts/ifup-eth | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysconfig/network-scripts/ifup-eth') diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 634cb4fe..c0169192 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -150,7 +150,7 @@ if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then fi # If the device is part of a bridge, add the device to the bridge -if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then +if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then if [ ! -d /sys/class/net/${BRIDGE}/bridge ]; then /usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null fi @@ -167,7 +167,7 @@ if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then exit 0 fi -if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then +if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then ONESHOT=""; else @@ -270,7 +270,7 @@ else # Set a default route. if [ "${DEFROUTE}" != "no" ] && [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then # set up default gateway. replace if one already exists - if [ -n "${GATEWAY}" -a "$(ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then + if [ -n "${GATEWAY}" ] && [ "$(ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then ip route replace default ${METRIC:+metric $METRIC} \ via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \ ${GATEWAYDEV:+dev $GATEWAYDEV} -- cgit v1.2.1