mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-18 20:10:56 +00:00
Merge pull request #1728 from pi-hole/new/nuke_lists
Add nuclear option to list.sh
This commit is contained in:
commit
e0edac32c7
@ -49,7 +49,8 @@ Options:
|
|||||||
-nr, --noreload Update ${type}list without refreshing dnsmasq
|
-nr, --noreload Update ${type}list without refreshing dnsmasq
|
||||||
-q, --quiet Make output less verbose
|
-q, --quiet Make output less verbose
|
||||||
-h, --help Show this help dialog
|
-h, --help Show this help dialog
|
||||||
-l, --list Display all your ${type}listed domains"
|
-l, --list Display all your ${type}listed domains
|
||||||
|
--nuke Removes all entries in a list"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -223,6 +224,15 @@ Displaylist() {
|
|||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NukeList() {
|
||||||
|
if [[ -f "${listMain}" ]]; then
|
||||||
|
# Back up original list
|
||||||
|
cp "${listMain}" "${listMain}.bck~"
|
||||||
|
# Empty out file
|
||||||
|
echo "" > "${listMain}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
for var in "$@"; do
|
for var in "$@"; do
|
||||||
case "${var}" in
|
case "${var}" in
|
||||||
"-w" | "whitelist" ) listMain="${whitelist}"; listAlt="${blacklist}";;
|
"-w" | "whitelist" ) listMain="${whitelist}"; listAlt="${blacklist}";;
|
||||||
@ -234,6 +244,7 @@ for var in "$@"; do
|
|||||||
"-q" | "--quiet" ) verbose=false;;
|
"-q" | "--quiet" ) verbose=false;;
|
||||||
"-h" | "--help" ) helpFunc;;
|
"-h" | "--help" ) helpFunc;;
|
||||||
"-l" | "--list" ) Displaylist;;
|
"-l" | "--list" ) Displaylist;;
|
||||||
|
"--nuke" ) NukeList;;
|
||||||
* ) HandleOther "${var}";;
|
* ) HandleOther "${var}";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user