mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
shell check recomends
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
3231e5c3ba
commit
1f03faddef
1 changed files with 3 additions and 6 deletions
|
@ -40,9 +40,6 @@ gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql"
|
||||||
optimize_database=false
|
optimize_database=false
|
||||||
|
|
||||||
domainsExtension="domains"
|
domainsExtension="domains"
|
||||||
matterAndLight="${basename}.0.matterandlight.txt"
|
|
||||||
parsedMatter="${basename}.1.parsedmatter.txt"
|
|
||||||
preEventHorizon="list.preEventHorizon"
|
|
||||||
|
|
||||||
resolver="pihole-FTL"
|
resolver="pihole-FTL"
|
||||||
|
|
||||||
|
@ -92,7 +89,7 @@ generate_gravity_database() {
|
||||||
|
|
||||||
update_gravity_timestamp() {
|
update_gravity_timestamp() {
|
||||||
# Update timestamp when the gravity table was last updated successfully
|
# Update timestamp when the gravity table was last updated successfully
|
||||||
output=$( { sqlite3 "${gravityDBfile}" <<< "INSERT OR REPLACE INTO info (property,value) values (\"updated\",cast(strftime('%s', 'now') as int));"; } 2>&1 )
|
output=$( { sqlite3 "${gravityDBfile}" <<< "INSERT OR REPLACE INTO info (property,value) values ('updated',cast(strftime('%s', 'now') as int));"; } 2>&1 )
|
||||||
status="$?"
|
status="$?"
|
||||||
|
|
||||||
if [[ "${status}" -ne 0 ]]; then
|
if [[ "${status}" -ne 0 ]]; then
|
||||||
|
@ -459,7 +456,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||||
|
|
||||||
# Parse source files into domains format
|
# Parse source files into domains format
|
||||||
gravity_ParseFileIntoDomains() {
|
gravity_ParseFileIntoDomains() {
|
||||||
local source="${1}" destination="${2}" firstLine abpFilter
|
local source="${1}" destination="${2}" firstLine
|
||||||
|
|
||||||
# Determine if we are parsing a consolidated list
|
# Determine if we are parsing a consolidated list
|
||||||
#if [[ "${source}" == "${piholeDir}/${matterAndLight}" ]]; then
|
#if [[ "${source}" == "${piholeDir}/${matterAndLight}" ]]; then
|
||||||
|
@ -612,7 +609,7 @@ gravity_Cleanup() {
|
||||||
# Ensure this function only runs when gravity_SetDownloadOptions() has completed
|
# Ensure this function only runs when gravity_SetDownloadOptions() has completed
|
||||||
if [[ "${gravity_Blackbody:-}" == true ]]; then
|
if [[ "${gravity_Blackbody:-}" == true ]]; then
|
||||||
# Remove any unused .domains files
|
# Remove any unused .domains files
|
||||||
for file in ${piholeDir}/*.${domainsExtension}; do
|
for file in "${piholeDir}"/*."${domainsExtension}"; do
|
||||||
# If list is not in active array, then remove it
|
# If list is not in active array, then remove it
|
||||||
if [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then
|
if [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then
|
||||||
rm -f "${file}" 2> /dev/null || \
|
rm -f "${file}" 2> /dev/null || \
|
||||||
|
|
Loading…
Reference in a new issue