aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-10 15:55:25 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-10 15:55:25 +1200
commitf4180f3e6e846aaa568136ddd9e395c0b88c1e64 (patch)
tree5522dbf537ef4e207b79f8b866483d94791c06e5
parentAdd VERSION (diff)
parentBump VERSION (diff)
downloadnwatch-f4180f3e6e846aaa568136ddd9e395c0b88c1e64.tar.gz
nwatch-f4180f3e6e846aaa568136ddd9e395c0b88c1e64.zip
Merge branch 'release/v2.0.0'v2.0.0
* release/v2.0.0: Bump VERSION Update documentation to reflect v2.0.0 Add some ad-hoc Awk filtering to the output Strip trailing lines Remove imposed structure Rename README to .md
-rw-r--r--README.md (renamed from README.markdown)4
-rw-r--r--VERSION2
-rwxr-xr-xnwatch (renamed from bin/nwatch)16
-rw-r--r--nwatch.1 (renamed from share/man/man1/nwatch.1)7
4 files changed, 20 insertions, 9 deletions
diff --git a/README.markdown b/README.md
index f1c5a3a..3df5148 100644
--- a/README.markdown
+++ b/README.md
@@ -13,8 +13,8 @@ Example with root privileges:
# nwatch /etc/nwatch.mynet /var/cache/nwatch/mynet
-Prints the results of an `ndiff(1)` call against the last known scan to stdout;
-intended to be called from `cron(8)`:
+Prints the filtered results of an `ndiff(1)` call against the last
+known scan to stdout; intended to be called from `cron(8)`:
0 0 * * 0 nwatch /etc/nwatch.mynet /var/cache/nwatch/mynet
diff --git a/VERSION b/VERSION
index 3eefcb9..227cea2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.0
+2.0.0
diff --git a/bin/nwatch b/nwatch
index eb28a52..c981fbc 100755
--- a/bin/nwatch
+++ b/nwatch
@@ -71,6 +71,18 @@ done
# Write diff to stdout if it exists (not an error if it doesn't)
if [[ -r $diff ]] ; then
- cat -- "$diff"
+ awk '/^[-+]Not shown: / { next }
+/^[-+]/ { diff = 1 }
+NF { lines[++l] = $0 }
+function write() {
+ if (diff) {
+ for (l in lines)
+ print lines[l]
+ print ""
+ }
+ diff = l = 0
+}
+!NF { write() }
+END { write() }
+' -- "$diff"
fi
-
diff --git a/share/man/man1/nwatch.1 b/nwatch.1
index 109d891..d35d469 100644
--- a/share/man/man1/nwatch.1
+++ b/nwatch.1
@@ -1,4 +1,4 @@
-.TH NWATCH 1 "May 2014" "Manual page for nwatch"
+.TH NWATCH 1 "July 2018" "Manual page for nwatch"
.SH NAME
.B nwatch
\- slightly nicer Nmap ndiff(1) wrapper
@@ -18,8 +18,8 @@ and runs an nmap(1) command suitable for running through ndiff(1) against those
hosts. It caches the scan output in plain text, greppable, and XML formats in
.I CACHEDIR
and then runs ndiff(1) between the last scan it can find and the current scan,
-storing the output in CACHEDIR and printing it to stdout. This makes it useful
-for running from cron(8):
+storing the output in CACHEDIR and printing it to stdout, after an attempt at
+some intelligent filtering. This makes it useful for running from cron(8):
.PP
0 0 * * 0 nwatch /etc/nwatch.mynet /var/cache/nwatch/mynet
.PP
@@ -34,4 +34,3 @@ privileges.
nmap(1), ndiff(1), runcrypt(1), Mail::Run::Crypt(3)
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>
-