In ./advanced/Scripts/database_migration/gravity-db.sh line 18:

piholeDir="${2}"
    ^-------^ SC2034 (warning): piholeDir appears unused. Verify use (or export if used externally).

Turns out it is _actually_ unused, the full path of the gravity database is passed to the function, so we'll tidy this up rather than supressing.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2025-04-04 23:41:43 +01:00
parent a624d3be8d
commit 59d2177271
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View File

@ -13,9 +13,8 @@
readonly scriptPath="/etc/.pihole/advanced/Scripts/database_migration/gravity"
upgrade_gravityDB(){
local database piholeDir version
local database version
database="${1}"
piholeDir="${2}"
# Exit early if the database does not exist (e.g. in CI tests)
if [[ ! -f "${database}" ]]; then

View File

@ -306,7 +306,7 @@ migrate_to_database() {
fi
# Check if gravity database needs to be updated
upgrade_gravityDB "${gravityDBfile}" "${piholeDir}"
upgrade_gravityDB "${gravityDBfile}"
# Migrate list files to new database
if [ -e "${adListFile}" ]; then
@ -334,7 +334,7 @@ migrate_to_database() {
fi
# Check if gravity database needs to be updated
upgrade_gravityDB "${gravityDBfile}" "${piholeDir}"
upgrade_gravityDB "${gravityDBfile}"
}
# Determine if DNS resolution is available before proceeding
@ -1100,7 +1100,7 @@ for var in "$@"; do
"-t" | "--timeit") timed=true ;;
"-r" | "--repair") repairSelector "$3" ;;
"-u" | "--upgrade")
upgrade_gravityDB "${gravityDBfile}" "${piholeDir}"
upgrade_gravityDB "${gravityDBfile}"
exit 0
;;
"-h" | "--help") helpFunc ;;