diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-06-11 11:33:02 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-06-11 11:45:58 +1200 |
commit | 057b2900d559f65ef4fba00c0a0d7084d92ea073 (patch) | |
tree | 8bb310704aa89b5249d420341ba7613bd9d84506 /bin | |
parent | Add version detection (diff) | |
download | nwatch-057b2900d559f65ef4fba00c0a0d7084d92ea073.tar.gz nwatch-057b2900d559f65ef4fba00c0a0d7084d92ea073.zip |
Catch ndiff(1) error condition properly
An exit value of 1 corresponds to there being some difference in the
output, which means the diff never gets sent. This change will force the
exit only if there's an actual error condition of 2, per the manual
page for ndiff(1).
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/nwatch | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -53,7 +53,11 @@ fi # If the link to the XML file is legible, run the diff or give up if [[ -r ${latest}.xml ]] ; then - if ! ndiff -- "$latest".xml "$cache".xml > "$diff" ; then + ndiff -- "$latest".xml "$cache".xml > "$diff" + + # Because we always want a report, only exit if an actual error condition + # (1 means there's a meaningful diff in the scans) + if (($? == 2)) ; then exit fi fi |