aboutsummaryrefslogtreecommitdiffstats
path: root/network-scripts/ifup
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
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')
-rwxr-xr-xnetwork-scripts/ifup10
1 files changed, 5 insertions, 5 deletions
diff --git a/network-scripts/ifup b/network-scripts/ifup
index 397dd93b..9c1380bb 100755
--- a/network-scripts/ifup
+++ b/network-scripts/ifup
@@ -58,11 +58,11 @@ if ! is_true ${DEPRECATION_WARNING_ISSUED}; then
net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifup >&2
fi
-if [ "foo$2" = "fooboot" ] && [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ]
+if [ "foo$2" = "fooboot" ] && is_false "${ONBOOT}"
then
exit 0
fi
-if [ -n "$IN_HOTPLUG" ] && [ "${HOTPLUG}" = "no" -o "${HOTPLUG}" = "NO" ]
+if [ -n "$IN_HOTPLUG" ] && is_false "${HOTPLUG}"
then
exit 0
fi
@@ -81,7 +81,7 @@ if [ "$_use_nm" = "true" -a -n "$UUID" -a "$REALDEVICE" != "lo" ]; then
fi
# Ethernet 802.1Q VLAN support
-if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ] && [ -n "$DEVICE" ]; then
+if is_true "${VLAN}" && is_false "$ISALIAS" && [ -n "$DEVICE" ]; then
if [ -n "${VID}" ]; then
if test -z "$PHYSDEV"; then
net_log $"PHYSDEV should be set for device ${DEVICE}"
@@ -125,11 +125,11 @@ if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ] && [ -n "$DEVICE" ]; then
check_device_down ${PHYSDEV} && { ip -o link set dev ${PHYSDEV} up; }
if [ ! -f /proc/net/vlan/${DEVICE} ]; then
- if [ "${REORDER_HDR}" = "no" -o "${REORDER_HDR}" = "0" ]; then
+ if is_false "${REORDER_HDR}"; then
FLAG_REORDER_HDR="reorder_hdr off"
fi
- if [ "${GVRP}" = "yes" -o "${GVRP}" = "1" ]; then
+ if is_true "${GVRP}"; then
FLAG_GVRP="gvrp on"
fi