Skip to content

Commit cd8120d

Browse files
committed
Add some output to the --nuke command
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
1 parent bd982c6 commit cd8120d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

advanced/Scripts/list.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,14 @@ Displaylist() {
231231
}
232232

233233
NukeList() {
234-
sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};"
234+
count=$(sqlite3 "${gravityDBfile}" "SELECT COUNT(1) FROM domainlist WHERE type = ${typeId};")
235+
listname="$(GetListnameFromTypeId "${typeId}")"
236+
if [ "$count" -gt 0 ];then
237+
sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};"
238+
echo " ${TICK} Removed ${count} domain(s) from the ${listname}"
239+
else
240+
echo " ${INFO} ${listname} already empty. Nothing to do!"
241+
fi
235242
exit 0;
236243
}
237244

0 commit comments

Comments
 (0)