1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

add flag to skip download of lists

This commit is contained in:
Promofaux 2016-10-19 22:06:19 +01:00
parent 25343da6b7
commit 59ba6f8aec

View File

@ -54,6 +54,8 @@ supernova=${basename}.1.supernova.txt
eventHorizon=${basename}.2.eventHorizon.txt eventHorizon=${basename}.2.eventHorizon.txt
accretionDisc=${basename}.3.accretionDisc.txt accretionDisc=${basename}.3.accretionDisc.txt
skipDownload=false
# Warn users still using pihole.conf that it no longer has any effect (I imagine about 2 people use it) # Warn users still using pihole.conf that it no longer has any effect (I imagine about 2 people use it)
if [[ -r ${piholeDir}/pihole.conf ]];then if [[ -r ${piholeDir}/pihole.conf ]];then
echo "::: pihole.conf file no longer supported. Over-rides in this file are ignored." echo "::: pihole.conf file no longer supported. Over-rides in this file are ignored."
@ -162,7 +164,7 @@ gravity_spinup() {
agent="Mozilla/10.0" agent="Mozilla/10.0"
echo -n "::: Getting $domain list..."
# Use a case statement to download lists that need special cURL commands # Use a case statement to download lists that need special cURL commands
# to complete properly and reset the user agent when required # to complete properly and reset the user agent when required
@ -179,7 +181,12 @@ gravity_spinup() {
# Default is a simple request # Default is a simple request
*) cmd_ext="" *) cmd_ext=""
esac esac
if [[ "${skipDownload}" == false ]]; then
echo -n "::: Getting $domain list..."
gravity_transport "$url" "$cmd_ext" "$agent" gravity_transport "$url" "$cmd_ext" "$agent"
else
echo "::: Using cached $domain list"
fi
done done
} }
@ -345,15 +352,18 @@ gravity_reload() {
} }
for var in "$@" for var in "$@"
do do
case "$var" in case "$var" in
"-f" | "--force" ) forceGrav=true;; "-f" | "--force" ) forceGrav=true;;
"-h" | "--help" ) helpFunc;; "-h" | "--help" ) helpFunc;;
"-sd" | "--skip-download" ) skipDownload=true;;
esac esac
done done
if [[ ${forceGrav} == true ]]; then if [[ "${forceGrav}" == true ]]; then
echo -n "::: Deleting exising list cache..." echo -n "::: Deleting exising list cache..."
rm /etc/pihole/list.* rm /etc/pihole/list.*
echo " done!" echo " done!"