From be3e198f9a83989a6db71011a294cdce0ef7f56c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 7 Jul 2019 10:46:20 +0200 Subject: [PATCH] Address linting errors. Signed-off-by: DL6ER --- advanced/Scripts/database_migration/gravity-db.sh | 8 +++++--- gravity.sh | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/advanced/Scripts/database_migration/gravity-db.sh b/advanced/Scripts/database_migration/gravity-db.sh index 714676f4..294fd32a 100644 --- a/advanced/Scripts/database_migration/gravity-db.sh +++ b/advanced/Scripts/database_migration/gravity-db.sh @@ -11,13 +11,15 @@ # Please see LICENSE file for your rights under this license. upgrade_gravityDB(){ - local version - version="$(sqlite3 "$1" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")" + local database auditFile version + database="${1}" + auditFile="${2}" + version="$(sqlite3 "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")" if [[ "$version" == "1" ]]; then # This migration script upgrades the gravity.db file by # adding the domain_auditlist table - sqlite3 "$1" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/1_to_2.sql" + sqlite3 "${database}" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/1_to_2.sql" version=2 # Store audit domains in database table diff --git a/gravity.sh b/gravity.sh index e2f2a9a8..89f77ce0 100755 --- a/gravity.sh +++ b/gravity.sh @@ -17,6 +17,7 @@ coltable="/opt/pihole/COL_TABLE" source "${coltable}" regexconverter="/opt/pihole/wildcard_regex_converter.sh" source "${regexconverter}" +# shellcheck disable=SC1091 source "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh" basename="pihole" @@ -187,7 +188,7 @@ migrate_to_database() { fi # Check if gravity database needs to be updated - upgrade_gravityDB "${gravityDBfile}" + upgrade_gravityDB "${gravityDBfile}" "${auditFile}" } # Determine if DNS resolution is available before proceeding