Address linting errors.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-07-07 10:46:20 +02:00
parent acc50b709e
commit be3e198f9a
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD
2 changed files with 7 additions and 4 deletions

View file

@ -11,13 +11,15 @@
# Please see LICENSE file for your rights under this license. # Please see LICENSE file for your rights under this license.
upgrade_gravityDB(){ upgrade_gravityDB(){
local version local database auditFile version
version="$(sqlite3 "$1" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")" database="${1}"
auditFile="${2}"
version="$(sqlite3 "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")"
if [[ "$version" == "1" ]]; then if [[ "$version" == "1" ]]; then
# This migration script upgrades the gravity.db file by # This migration script upgrades the gravity.db file by
# adding the domain_auditlist table # 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 version=2
# Store audit domains in database table # Store audit domains in database table

View file

@ -17,6 +17,7 @@ coltable="/opt/pihole/COL_TABLE"
source "${coltable}" source "${coltable}"
regexconverter="/opt/pihole/wildcard_regex_converter.sh" regexconverter="/opt/pihole/wildcard_regex_converter.sh"
source "${regexconverter}" source "${regexconverter}"
# shellcheck disable=SC1091
source "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh" source "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh"
basename="pihole" basename="pihole"
@ -187,7 +188,7 @@ migrate_to_database() {
fi fi
# Check if gravity database needs to be updated # Check if gravity database needs to be updated
upgrade_gravityDB "${gravityDBfile}" upgrade_gravityDB "${gravityDBfile}" "${auditFile}"
} }
# Determine if DNS resolution is available before proceeding # Determine if DNS resolution is available before proceeding