From cd8120d33f279f44e6c1922c4ec14788ed12898c Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 16 Nov 2020 23:31:35 +0000 Subject: [PATCH] Add some output to the --nuke command Signed-off-by: Adam Warner --- advanced/Scripts/list.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 9dd818c4..16bb2001 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -231,7 +231,14 @@ Displaylist() { } NukeList() { - sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};" + count=$(sqlite3 "${gravityDBfile}" "SELECT COUNT(1) FROM domainlist WHERE type = ${typeId};") + listname="$(GetListnameFromTypeId "${typeId}")" + if [ "$count" -gt 0 ];then + sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};" + echo " ${TICK} Removed ${count} domain(s) from the ${listname}" + else + echo " ${INFO} ${listname} already empty. Nothing to do!" + fi exit 0; }