diff options
author | DL6ER <dl6er@dl6er.de> | 2019-10-03 13:12:32 +0300 |
---|---|---|
committer | DL6ER <dl6er@dl6er.de> | 2019-10-03 13:12:32 +0300 |
commit | d883854aadb5f56075a6fe51cbe3ec59daf6751c (patch) | |
tree | 33dff45dd8b744c422f7a7570ff0fc093133af7e /advanced | |
parent | 756c99653e6e20afc48b4728941b4f2173c21c4b (diff) |
Use constant for long path.
Signed-off-by: DL6ER <dl6er@dl6er.de>
Diffstat (limited to 'advanced')
-rw-r--r-- | advanced/Scripts/database_migration/gravity-db.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/advanced/Scripts/database_migration/gravity-db.sh b/advanced/Scripts/database_migration/gravity-db.sh index 7eba43c0..773898b0 100644 --- a/advanced/Scripts/database_migration/gravity-db.sh +++ b/advanced/Scripts/database_migration/gravity-db.sh @@ -10,6 +10,8 @@ # This file is copyright under the latest version of the EUPL. # Please see LICENSE file for your rights under this license. +readonly scriptPath="/etc/.pihole/advanced/Scripts/database_migration/gravity" + upgrade_gravityDB(){ local database piholeDir auditFile version database="${1}" @@ -23,7 +25,7 @@ upgrade_gravityDB(){ # This migration script upgrades the gravity.db file by # adding the domain_audit table echo -e " ${INFO} Upgrading gravity database from version 1 to 2" - sqlite3 "${database}" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/1_to_2.sql" + sqlite3 "${database}" < "${scriptPath}/1_to_2.sql" version=2 # Store audit domains in database table @@ -38,13 +40,13 @@ upgrade_gravityDB(){ # renaming the regex table to regex_blacklist, and # creating a new regex_whitelist table + corresponding linking table and views echo -e " ${INFO} Upgrading gravity database from version 2 to 3" - sqlite3 "${database}" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/2_to_3.sql" + sqlite3 "${database}" < "${scriptPath}/2_to_3.sql" version=3 fi if [[ "$version" == "3" ]]; then # This migration script upgrades the gravity and adlist views # implementing necessary changes for per-client blocking - sqlite3 "${database}" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/3_to_4.sql" + sqlite3 "${database}" < "${scriptPath}/3_to_4.sql" version=3 fi } |