From 1f03faddef51b2b942ab432fe2487917dae7ee5a Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 9 Dec 2019 21:35:54 +0000 Subject: [PATCH] shell check recomends Signed-off-by: Adam Warner --- gravity.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gravity.sh b/gravity.sh index 5db14765..b04e8553 100755 --- a/gravity.sh +++ b/gravity.sh @@ -40,9 +40,6 @@ gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql" optimize_database=false domainsExtension="domains" -matterAndLight="${basename}.0.matterandlight.txt" -parsedMatter="${basename}.1.parsedmatter.txt" -preEventHorizon="list.preEventHorizon" resolver="pihole-FTL" @@ -92,7 +89,7 @@ generate_gravity_database() { update_gravity_timestamp() { # 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="$?" if [[ "${status}" -ne 0 ]]; then @@ -459,7 +456,7 @@ gravity_DownloadBlocklistFromUrl() { # Parse source files into domains format gravity_ParseFileIntoDomains() { - local source="${1}" destination="${2}" firstLine abpFilter + local source="${1}" destination="${2}" firstLine # Determine if we are parsing a consolidated list #if [[ "${source}" == "${piholeDir}/${matterAndLight}" ]]; then @@ -612,7 +609,7 @@ gravity_Cleanup() { # Ensure this function only runs when gravity_SetDownloadOptions() has completed if [[ "${gravity_Blackbody:-}" == true ]]; then # 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 [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then rm -f "${file}" 2> /dev/null || \