commit:     abcc0bd4c372e36cc6e5e46832e7664a72b6bcaa
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 21 05:22:09 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 05:32:11 2019 +0000
URL:        https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=abcc0bd4

init.d/net.lo.in: shellcheck: depend()

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 init.d/net.lo.in | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index 6d6b581..e49278f 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -34,10 +34,11 @@ MODULESLIST="${RC_SVCDIR}/nettree$(get_interface)"
 
 depend()
 {
-       local IFACE=$(get_interface)
-       local IFVAR=$(shell_var "${IFACE}")
+       local IFACE IFVAR
+       IFACE=$(get_interface)
+       IFVAR=$(shell_var "${IFACE}")
 
-       if [ "$RC_UNAME" = Linux -a "$IFACE" != lo ]; then
+       if [ "$RC_UNAME" = Linux ] && [ "$IFACE" != lo ]; then
                need sysfs
                after modules
        fi
@@ -54,14 +55,14 @@ depend()
        esac
 
        if [ "$(command -v "depend_${IFVAR}")" = "depend_${IFVAR}" ]; then
-               depend_${IFVAR}
+               "depend_${IFVAR}"
        fi
 
-       local dep= prov=
+       local dep prov
        for dep in need use before after provide keyword; do
                eval prov=\$rc_${dep}_${IFVAR}
                if [ -n "${prov}" ]; then
-                       ${dep} ${prov}
+                       "${dep}" "${prov}"
                        ewarn "rc_${dep}_${IFVAR} is deprecated."
                        ewarn "Please use rc_net_${IFVAR}_${dep} instead."
                fi

Reply via email to