mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Merge pull request #623 from pi-hole/AddForceClearToGravity
Add force clear to gravity
This commit is contained in:
commit
6f0b659b38
29
gravity.sh
29
gravity.sh
@ -27,6 +27,18 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function helpFunc()
|
||||||
|
{
|
||||||
|
echo "::: Pull in domains from adlists"
|
||||||
|
echo ":::"
|
||||||
|
echo "::: Usage: pihole -g"
|
||||||
|
echo ":::"
|
||||||
|
echo "::: Options:"
|
||||||
|
echo "::: -f, --force Force lists to be downloaded, even if they don't need updating."
|
||||||
|
echo "::: -h, --help Show this help dialog"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
piholeIPfile=/etc/pihole/piholeIP
|
piholeIPfile=/etc/pihole/piholeIP
|
||||||
piholeIPv6file=/etc/pihole/.useIPv6
|
piholeIPv6file=/etc/pihole/.useIPv6
|
||||||
|
|
||||||
@ -328,6 +340,23 @@ function gravity_reload() {
|
|||||||
echo " done!"
|
echo " done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for var in "$@"
|
||||||
|
do
|
||||||
|
case "$var" in
|
||||||
|
"-f" | "--force" ) force=true;;
|
||||||
|
"-h" | "--help" ) helpFunc;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
#Overwrite adlists.default from /etc/.pihole in case any changes have been made. Changes should be saved in /etc/adlists.list
|
||||||
|
|
||||||
|
if $force; then
|
||||||
|
echo -n "::: Deleting exising list cache..."
|
||||||
|
$SUDO rm /etc/pihole/list.*
|
||||||
|
echo " done!"
|
||||||
|
fi
|
||||||
|
|
||||||
$SUDO cp /etc/.pihole/adlists.default /etc/pihole/adlists.default
|
$SUDO cp /etc/.pihole/adlists.default /etc/pihole/adlists.default
|
||||||
gravity_collapse
|
gravity_collapse
|
||||||
gravity_spinup
|
gravity_spinup
|
||||||
|
Loading…
Reference in New Issue
Block a user