Address linting errors.

Signed-off-by: DL6ER <dl6er@dl6er.de>
pull/2832/head
DL6ER 5 years ago
parent acc50b709e
commit be3e198f9a
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

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

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

Loading…
Cancel
Save