aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/ifdown-eth
diff options
context:
space:
mode:
authorJan Macku <jamacku@redhat.com>2019-09-12 12:32:36 +0200
committerGitHub <noreply@github.com>2019-09-12 12:32:36 +0200
commit66d26269a83229b7340f7ace06dfc715c04df7d8 (patch)
treed25afcbba9d13d50f62fe8177ab4863c0c220c47 /network-scripts/ifdown-eth
parentdd703a8494647d401dbffa0f036233e08044ec60 (diff)
downloadinitscripts-66d26269a83229b7340f7ace06dfc715c04df7d8.tar
initscripts-66d26269a83229b7340f7ace06dfc715c04df7d8.tar.gz
initscripts-66d26269a83229b7340f7ace06dfc715c04df7d8.tar.bz2
initscripts-66d26269a83229b7340f7ace06dfc715c04df7d8.tar.xz
initscripts-66d26269a83229b7340f7ace06dfc715c04df7d8.zip
Repalace hardcoded tests for yes and no with testing functions
Resolve issue: #42
Diffstat (limited to 'network-scripts/ifdown-eth')
-rwxr-xr-xnetwork-scripts/ifdown-eth8
1 files changed, 4 insertions, 4 deletions
diff --git a/network-scripts/ifdown-eth b/network-scripts/ifdown-eth
index c610fd20..7b457e85 100755
--- a/network-scripts/ifdown-eth
+++ b/network-scripts/ifdown-eth
@@ -29,13 +29,13 @@ source_config
. /etc/sysconfig/network
# Check to make sure the device is actually up
-check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" -a "$VLAN" != "yes" ] && exit 0
+check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" ] && ! is_true "$VLAN" && exit 0
if [ -n "${TEAM_MASTER}" ] && [ ! "${DEVICETYPE}" = "TeamPort" ] && [ -x ./ifdown-TeamPort ]; then
./ifdown-TeamPort ${CONFIG} $2
fi
-if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then
+if ! is_true "${SLAVE}" || [ -z "${MASTER}" ]; then
if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
FOUNDMACADDR=$(get_hwaddr ${REALDEVICE})
if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then
@@ -125,7 +125,7 @@ if [ -d "/sys/class/net/${REALDEVICE}" ]; then
ip -4 addr flush dev ${REALDEVICE} ${LABEL} scope host 2>/dev/null
fi
- if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
+ if is_true "${SLAVE}" && [ -n "${MASTER}" ]; then
echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
fi
@@ -167,7 +167,7 @@ if [ -n "${WIRELESS_ENC_KEY}" ] && [ -x /sbin/iwconfig ]; then
/sbin/iwconfig ${DEVICE} enc 0 >/dev/null 2>&1
fi
-if [ "$retcode" = 0 ] ; then
+if [ "$retcode" = "0" ]; then
/etc/sysconfig/network-scripts/ifdown-post $CONFIG
# do NOT use $? because ifdown should return whether or not
# the interface went down.