aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/ifup-aliases
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/ifup-aliases
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/ifup-aliases')
-rwxr-xr-xnetwork-scripts/ifup-aliases12
1 files changed, 6 insertions, 6 deletions
diff --git a/network-scripts/ifup-aliases b/network-scripts/ifup-aliases
index 8a943c1b..8020f407 100755
--- a/network-scripts/ifup-aliases
+++ b/network-scripts/ifup-aliases
@@ -206,7 +206,7 @@ function new_interface ()
eval $(/bin/ipcalc --broadcast ${IPADDR}/${PREFIX})
fi
- if [ "$no_devices_are_up" = "yes" ]; then
+ if is_true "$no_devices_are_up"; then
setup_this=yes
else
@@ -262,8 +262,8 @@ function new_interface ()
/sbin/ip addr change ${IPADDR}/${PREFIX} brd ${BROADCAST}
fi
- if [ "$setup_this" = "yes" ] ; then
- if [ "${parent_device}" != "lo" ] && [ "${ARPCHECK}" != "no" ] && \
+ if is_true "$setup_this"; then
+ if [ "${parent_device}" != "lo" ] && ! is_false "${ARPCHECK}" && \
is_available ${parent_device} && \
( grep -qswi "up" /sys/class/net/${parent_device}/operstate || grep -qswi "1" /sys/class/net/${parent_device}/carrier ) ; then
echo $"Determining if ip address ${IPADDR} is already in use for device ${parent_device}..."
@@ -287,7 +287,7 @@ function new_interface ()
! is_false "$IPV6INIT" && \
/etc/sysconfig/network-scripts/ifup-ipv6 ${DEVICE}
- if [ "$NO_ALIASROUTING" != yes ]; then
+ if ! is_true "$NO_ALIASROUTING"; then
GATEWAYDEV=$network_GATEWAYDEV;
@@ -317,7 +317,7 @@ for FILE in ifcfg-${parent_device}:* ; do
ini_env
. ./$FILE
[ -z "$DEVICE" ] && DEVICE=${FILE##ifcfg-}
- [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface
+ ! is_false "$ONPARENT" && new_interface
unset DEVICE
done
@@ -347,7 +347,7 @@ for FILE in ifcfg-${parent_device}-range* ; do
IPADDR="$ipaddr_prefix.$ipaddr_num"
DEVICE="$parent_device:$ipaddr_clonenum"
IPV6INIT="no"
- [ "$ONPARENT" != "no" -a "$ONPARENT" != "NO" ] && new_interface
+ ! is_false "$ONPARENT" && new_interface
ipaddr_num=$(($ipaddr_num+1))
ipaddr_clonenum=$(($ipaddr_clonenum+1))
done