From abcc0bd4c372e36cc6e5e46832e7664a72b6bcaa Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 20 Apr 2019 22:22:09 -0700 Subject: init.d/net.lo.in: shellcheck: depend() Signed-off-by: Robin H. Johnson --- 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 -- cgit v1.2.3-65-gdbad