From 66d26269a83229b7340f7ace06dfc715c04df7d8 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Thu, 12 Sep 2019 12:32:36 +0200 Subject: Repalace hardcoded tests for yes and no with testing functions Resolve issue: #42 --- etc/rc.d/init.d/network | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'etc/rc.d/init.d/network') diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network index e3560b64..414bee06 100755 --- a/etc/rc.d/init.d/network +++ b/etc/rc.d/init.d/network @@ -28,7 +28,7 @@ fi # Check that networking is up. -[ "${NETWORKING}" = "no" ] && exit 6 +is_false "${NETWORKING}" && exit 6 # if the ip configuration utility isn't around we can't function. [ -x /sbin/ip ] || exit 1 @@ -76,13 +76,11 @@ start) # bring up loopback interface action $"Bringing up loopback interface: " ./ifup ifcfg-lo - case "$VLAN" in - yes) + if is_true "$VLAN" ; then if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1 ; then net_log $"No 802.1Q VLAN support available in kernel." fi - ;; - esac + fi vlaninterfaces="" vpninterfaces="" @@ -99,7 +97,7 @@ start) if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - if [ "$SLAVE" = "yes" ] && ( ! is_nm_running || is_false $NM_CONTROLLED ) ; then + if is_true "$SLAVE" && ( ! is_nm_running || is_false "$NM_CONTROLLED" ) ; then continue fi -- cgit v1.2.1