From 6ca00b6bc62b971c9c6024ade89c13a2aca281cc Mon Sep 17 00:00:00 2001
From: Manuel Friedli <manuel@fritteli.ch>
Date: Tue, 18 Aug 2020 23:54:37 +0200
Subject: [PATCH] Show the duration of the run in seconds when the scripts
 exits sucessfully.

---
 ddos-mitigator.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ddos-mitigator.sh b/ddos-mitigator.sh
index 0cd158d..43b63b6 100755
--- a/ddos-mitigator.sh
+++ b/ddos-mitigator.sh
@@ -42,6 +42,8 @@ MY_IP="94.199.214.20"
 MY_PORT="443"
 
 # After this point, no editing is required.
+start=$(date +%s)
+
 # These suffixes must be appended to the respective addresses and subnets.
 suffix8="/8"
 suffix16="/16"
@@ -501,4 +503,6 @@ while read -r addrwithsuffix ; do
 	exec_as_root fail2ban-client set "${jail}" banip "${addrwithsuffix}"
 done < "${banlist}"
 
-echo "${green}All done!${reset}"
+end=$(date +%s)
+
+echo "${green}All done in $((end - start)) seconds!${reset}"