Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 3.1.5 (2011-03-01)

 * display time it took and number of hosts scanned
  • Loading branch information...
commit 3a07b376872e9e271fd691b84725b3442f8762c2 1 parent 14b8948
@jschauma authored
Showing with 15 additions and 1 deletion.
  1. +3 −0  CHANGES
  2. +12 −1 src/scanmaster
View
3  CHANGES
@@ -1,3 +1,6 @@
+Version 3.1.5 (2011-03-01)
+ * display time it took and number of hosts scanned
+
Version 3.1.4.1 (2011-02-05)
* add autopw password injector
View
13 src/scanmaster
@@ -50,6 +50,7 @@
AGGREGATOR=""
AUTHMODE="pubkey"
+STARTDATE=$(date +%s)
FULLDATE=$(date +%Y%m%d%H%M)
DATE=$(date +%Y%m%d)
DIR="/mnt/scanmaster"
@@ -241,7 +242,7 @@ EOH
# inputs : none
waitForAll() {
- local count time
+ local count diff minutes num_in now seconds time
while [ 1 ]; do
count=$(find ${PREFIX}/* -maxdepth 2 -name '.done' -print 2>/dev/null | wc -l)
@@ -257,6 +258,16 @@ waitForAll() {
sleep 10
done
done
+ now=$(date +%s)
+ diff=$(( ${now} - ${STARTDATE}))
+ minutes=0
+ seconds=${diff}
+ if [ ${diff} -gt 60 ]; then
+ minutes=$(( ${seconds} / 60 ))
+ seconds=$(( ${seconds} % 60 ))
+ fi
+ num_in=$(wc -l <${INPUT})
+ echo "$(date +%T): Scanned ${num_in} hosts in ${minutes} minutes and ${seconds} seconds."
}
Please sign in to comment.
Something went wrong with that request. Please try again.