From 09da5974a4f84cf81462baa964414500424ec867 Mon Sep 17 00:00:00 2001 From: openoms Date: Sun, 7 Apr 2024 16:20:07 +0200 Subject: [PATCH] shellcheck disable SC2068 and SC2145 --- home.admin/_cache.sh | 12 ++++++++---- home.admin/_commands.sh | 3 ++- home.admin/config.scripts/blitz.conf.sh | 12 ++++++++---- home.admin/config.scripts/blitz.fatpack.sh | 6 ++++-- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/home.admin/_cache.sh b/home.admin/_cache.sh index 477273a0..0f22aa87 100755 --- a/home.admin/_cache.sh +++ b/home.admin/_cache.sh @@ -209,13 +209,15 @@ elif [ "$1" = "set" ] || [ "$1" = "init" ]; then elif [ "$1" = "get" ]; then position=0 - for keystr in "$@" + # shellcheck disable=SC2068 + for keystr in $@ do # skip first parameter ((position++)) if [ $position -eq 1 ]; then - echo "# _cache.sh $*" + # shellcheck disable=SC2145 + echo "# _cache.sh $@" continue fi @@ -429,13 +431,15 @@ elif [ "$1" = "valid" ]; then position=0 lasttouch_overall="" - for keystr in "$@" + # shellcheck disable=SC2068 + for keystr in $@ do # skip first parameter from script - thats the action string ((position++)) if [ $position -eq 1 ]; then - echo "# _cache.sh $*" + # shellcheck disable=SC2145 + echo "# _cache.sh $@" continue fi diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index 22fd6c6b..01eaa5b2 100755 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -278,7 +278,8 @@ function headless() { # command: cache function cache() { - sudo /home/admin/_cache.sh "$@" + # shellcheck disable=SC2068 + sudo /home/admin/_cache.sh $@ } # command: torthistx diff --git a/home.admin/config.scripts/blitz.conf.sh b/home.admin/config.scripts/blitz.conf.sh index eec71992..3e7e141a 100755 --- a/home.admin/config.scripts/blitz.conf.sh +++ b/home.admin/config.scripts/blitz.conf.sh @@ -23,7 +23,8 @@ if [ "$1" = "set" ]; then # check that key & value are given if [ "${keystr}" == "" ] || [ "${valuestr}" == "" ]; then - echo "# blitz.conf.sh $*" + # shellcheck disable=SC2145 + echo "# blitz.conf.sh $@" echo "# FAIL: missing parameter" exit 1 fi @@ -39,7 +40,8 @@ if [ "$1" = "set" ]; then # check that config file exists raspiblitzConfExists=$(ls ${configFile} 2>/dev/null | grep -c "${configFile}") if [ ${raspiblitzConfExists} -eq 0 ]; then - echo "# blitz.conf.sh $*" + # shellcheck disable=SC2145 + echo "# blitz.conf.sh $@" exit 3 fi @@ -87,7 +89,8 @@ elif [ "$1" = "list-add" ]; then # check that key & value are given if [ "${keystr}" == "" ] || [ "${valuestr}" == "" ]; then - echo "# blitz.conf.sh $*" + # shellcheck disable=SC2145 + echo "# blitz.conf.sh $@" echo "# FAIL: missing parameter" exit 1 fi @@ -141,7 +144,8 @@ elif [ "$1" = "list-remove" ]; then # check that key & value are given if [ "${keystr}" == "" ] || [ "${valuestr}" == "" ]; then - echo "# blitz.conf.sh $*" + # shellcheck disable=SC2145 + echo "# blitz.conf.sh $@" echo "# FAIL: missing parameter" exit 1 fi diff --git a/home.admin/config.scripts/blitz.fatpack.sh b/home.admin/config.scripts/blitz.fatpack.sh index d53e1d21..598b41af 100755 --- a/home.admin/config.scripts/blitz.fatpack.sh +++ b/home.admin/config.scripts/blitz.fatpack.sh @@ -53,10 +53,12 @@ if [ "${needsExpansion}" == "1" ]; then fi apt_install() { - sudo DEBIAN_FRONTEND=noninteractive apt install -y "$*" + # shellcheck disable=SC2068 + sudo DEBIAN_FRONTEND=noninteractive apt install -y ${@} if [ $? -eq 100 ]; then echo "FAIL! apt failed to install needed packages!" - echo "$*" + # shellcheck disable=SC2068 + echo ${@} exit 1 fi }