From f6ac0d73b4fd017096fda97d7cf3e991db1b6997 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 17 Aug 2016 19:08:55 +0100 Subject: [PATCH] Add force delete option --- gravity.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gravity.sh b/gravity.sh index b5b119f3..52d4ee5b 100755 --- a/gravity.sh +++ b/gravity.sh @@ -340,6 +340,23 @@ function gravity_reload() { 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 gravity_collapse gravity_spinup