mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-11-25 10:42:14 -05:00
Code format cleanups
This commit is contained in:
parent
d1e475da89
commit
9892d06c0d
13
gravity.sh
13
gravity.sh
@ -66,8 +66,7 @@ echo "** Neutrino emissions detected..."
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# patternCheck - check to see if curl downloaded any new files, and then process those
|
# patternCheck - check to see if curl downloaded any new files.
|
||||||
# files so they are in host format.
|
|
||||||
function gravity_patternCheck() {
|
function gravity_patternCheck() {
|
||||||
patternBuffer=$1
|
patternBuffer=$1
|
||||||
# check if the patternbuffer is a non-zero length file
|
# check if the patternbuffer is a non-zero length file
|
||||||
@ -83,7 +82,7 @@ function gravity_patternCheck() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# transport - curl the specified url with any needed command extentions, then patternCheck
|
# transport - curl the specified url with any needed command extentions
|
||||||
function gravity_transport() {
|
function gravity_transport() {
|
||||||
url=$1
|
url=$1
|
||||||
cmd_ext=$2
|
cmd_ext=$2
|
||||||
@ -109,7 +108,7 @@ function gravity_transport() {
|
|||||||
# spinup - main gravity function
|
# spinup - main gravity function
|
||||||
function gravity_spinup() {
|
function gravity_spinup() {
|
||||||
|
|
||||||
# Loop through domain list. Download each one and remove commented lines (lines beginning with '# 'or '/') and blank lines
|
# Loop through domain list. Download each one and remove commented lines (lines beginning with '# 'or '/') and # blank lines
|
||||||
for ((i = 0; i < "${#sources[@]}"; i++))
|
for ((i = 0; i < "${#sources[@]}"; i++))
|
||||||
do
|
do
|
||||||
url=${sources[$i]}
|
url=${sources[$i]}
|
||||||
@ -155,6 +154,7 @@ function gravity_Schwarzchild() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Pulsar - White/blacklist application
|
||||||
function gravity_pulsar() {
|
function gravity_pulsar() {
|
||||||
|
|
||||||
# Append blacklist entries if they exist
|
# Append blacklist entries if they exist
|
||||||
@ -206,11 +206,12 @@ function gravity_hostFormat() {
|
|||||||
cp $piholeDir/$accretionDisc $adList
|
cp $piholeDir/$accretionDisc $adList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# blackbody - remove any remnant files from script processes
|
||||||
function gravity_blackbody() {
|
function gravity_blackbody() {
|
||||||
# Loop through list files
|
# Loop through list files
|
||||||
for file in $piholeDir/*.$justDomainsExtension
|
for file in $piholeDir/*.$justDomainsExtension
|
||||||
do
|
do
|
||||||
# If list is active then leave it (noop) else rm the list
|
# If list is in active array then leave it (noop) else rm the list
|
||||||
if [[ " ${activeDomains[@]} " =~ " ${file} " ]]; then
|
if [[ " ${activeDomains[@]} " =~ " ${file} " ]]; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
@ -220,7 +221,6 @@ function gravity_blackbody() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gravity_advanced() {
|
function gravity_advanced() {
|
||||||
|
|
||||||
# Remove comments and print only the domain name
|
# Remove comments and print only the domain name
|
||||||
# Most of the lists downloaded are already in hosts file format but the spacing/formating is not contigious
|
# Most of the lists downloaded are already in hosts file format but the spacing/formating is not contigious
|
||||||
# This helps with that and makes it easier to read
|
# This helps with that and makes it easier to read
|
||||||
@ -230,6 +230,7 @@ function gravity_advanced() {
|
|||||||
|
|
||||||
numberOf=$(wc -l < $piholeDir/$supernova)
|
numberOf=$(wc -l < $piholeDir/$supernova)
|
||||||
echo "** $numberOf domains being pulled in by gravity..."
|
echo "** $numberOf domains being pulled in by gravity..."
|
||||||
|
|
||||||
gravity_unique
|
gravity_unique
|
||||||
|
|
||||||
sudo kill -HUP $(pidof dnsmasq)
|
sudo kill -HUP $(pidof dnsmasq)
|
||||||
|
Loading…
Reference in New Issue
Block a user