From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C4B6C138334 for ; Sun, 21 Apr 2019 05:34:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 16C66E0ACF; Sun, 21 Apr 2019 05:34:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DE594E0ACF for ; Sun, 21 Apr 2019 05:34:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E3815341BBC for ; Sun, 21 Apr 2019 05:34:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 692BB5C6 for ; Sun, 21 Apr 2019 05:34:03 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1555824807.ad3e0e73f5f9fbc8481dbee4f77fa8001ca78844.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: init.d/ X-VCS-Repository: proj/netifrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: ad3e0e73f5f9fbc8481dbee4f77fa8001ca78844 X-VCS-Branch: master Date: Sun, 21 Apr 2019 05:34:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aa4c4a0c-97b5-42b0-a330-1d0879989ca9 X-Archives-Hash: decf7d62daa6f4b6b8a520e4d1122622 commit: ad3e0e73f5f9fbc8481dbee4f77fa8001ca78844 Author: Robin H. Johnson gentoo org> AuthorDate: Sun Apr 21 05:23:19 2019 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun Apr 21 05:33:27 2019 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=ad3e0e73 init.d/net.lo.in: shellcheck: _gen_module_list() Signed-off-by: Robin H. Johnson gentoo.org> init.d/net.lo.in | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 77f0d8f..961d9fa 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -300,11 +300,11 @@ _get_errorhandler_behavior() { # Basically sorts our modules into order and saves the list _gen_module_list() { - local x= f= force=$1 + local x='' f='' force="$1" if ! ${force} ; then - if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt /proc/$$/status ]; then + if [ -s "${MODULESLIST}" ] && [ "${MODULESLIST}" -nt /proc/$$/status ]; then ewarn "Discarding cached module list ($MODULESLIST) as it's newer current time!" - elif [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then + elif [ -s "${MODULESLIST}" ] && [ "${MODULESLIST}" -nt "${MODULESDIR}" ]; then local update=false for x in "${MODULESDIR}"/*.sh; do [ -e "${x}" ] || continue @@ -333,7 +333,7 @@ _gen_module_list() } program() { - if [ "$1" = "start" -o "$1" = "stop" ]; then + if [ "$1" = "start" ] || [ "$1" = "stop" ]; then local s="$1" shift eval ${MODULE}_program_${s}="\"\${${MODULE}_program_${s}}\${${MODULE}_program_${s}:+ }$*\"" @@ -345,7 +345,7 @@ _gen_module_list() provide() { eval ${MODULE}_provide="\"\${${MODULE}_provide}\${${MODULE}_provide:+ }$*\"" local x - for x in $*; do + for x in "$@"; do eval ${x}_providedby="\"\${${MODULE}_providedby}\${${MODULE}_providedby:+ }${MODULE}\"" done } @@ -356,7 +356,7 @@ _gen_module_list() . "${MODULE}" || continue MODULE=${MODULE#${MODULESDIR}/} MODULE=${MODULE%.sh} - eval ${MODULE}_depend + eval "${MODULE}_depend" MODULES="${MODULES} ${MODULE}" done @@ -402,13 +402,13 @@ _gen_module_list() eval PROGRAM_START=\$${MODULE}_program_start eval PROGRAM_STOP=\$${MODULE}_program_stop eval PROVIDE=\$${MODULE}_provide - echo "module_${i}='${MODULE}'" >> "${TMPMODULESLIST}" - echo "module_${i}_program='${PROGRAM}'" >> "${TMPMODULESLIST}" - echo "module_${i}_program_start='${PROGRAM_START}'" >> "${TMPMODULESLIST}" - echo "module_${i}_program_stop='${PROGRAM_STOP}'" >> "${TMPMODULESLIST}" - echo "module_${i}_provide='${PROVIDE}'" >> "${TMPMODULESLIST}" + echo "module_${i}='${MODULE}'" + echo "module_${i}_program='${PROGRAM}'" + echo "module_${i}_program_start='${PROGRAM_START}'" + echo "module_${i}_program_stop='${PROGRAM_STOP}'" + echo "module_${i}_provide='${PROVIDE}'" : $(( i += 1 )) - done + done >> "${TMPMODULESLIST}" echo "module_${i}=" >> "${TMPMODULESLIST}" mv -f "${TMPMODULESLIST}" "${MODULESLIST}" )