mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Invert logic to reduce nesting
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
008e88b84b
commit
0cfecd31d3
1 changed files with 27 additions and 25 deletions
|
@ -149,8 +149,11 @@ database_table_from_file() {
|
||||||
|
|
||||||
# Migrate pre-v5.0 list files to database-based Pi-hole versions
|
# Migrate pre-v5.0 list files to database-based Pi-hole versions
|
||||||
migrate_to_database() {
|
migrate_to_database() {
|
||||||
# Create database file if not present
|
# Create database file only if not present
|
||||||
if [ ! -e "${gravityDBfile}" ]; then
|
if [ -e "${gravityDBfile}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e " ${INFO} Creating new gravity database"
|
echo -e " ${INFO} Creating new gravity database"
|
||||||
generate_gravity_database
|
generate_gravity_database
|
||||||
|
|
||||||
|
@ -175,7 +178,6 @@ migrate_to_database() {
|
||||||
echo -e " ${INFO} Migrating content of ${regexFile} into new database"
|
echo -e " ${INFO} Migrating content of ${regexFile} into new database"
|
||||||
database_table_from_file "regex" "${regexFile}"
|
database_table_from_file "regex" "${regexFile}"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determine if DNS resolution is available before proceeding
|
# Determine if DNS resolution is available before proceeding
|
||||||
|
|
Loading…
Reference in a new issue