From 82476138c151eba69c223943eb7ef1aa60cfed78 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 5 Jul 2019 16:09:13 +0200 Subject: [PATCH] Instead of calling sqlite3 multiple times within a loop, we use the ability to add multiple rows within one INSERT clause. This is supported since sqlite3 3.7.11 (2012-03-20) and should be available on all systems. Signed-off-by: DL6ER --- advanced/Scripts/webpage.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 9a6ddfc9..3996f7d0 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -546,12 +546,15 @@ addAudit() { shift # skip "-a" shift # skip "audit" + local domains="('${1}')" + shift # skip first domain, as it has already been added for domain in "$@" do # Insert only the domain here. The date_added field will be # filled with its default value (date_added = current timestamp) - sqlite3 "${gravityDBfile}" "INSERT INTO \"audit\" (domain) VALUES ('${domain}');" + domains="${domains},('${domain}')" done + sqlite3 "${gravityDBfile}" "INSERT INTO \"audit\" (domain) VALUES ${domains};" } clearAudit()