shellcheck disable SC2068 and SC2145

This commit is contained in:
openoms 2024-04-07 16:20:07 +02:00
parent 097016c71f
commit 09da5974a4
No known key found for this signature in database
GPG Key ID: 5BFB77609B081B65
4 changed files with 22 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}