diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-06-11 11:52:35 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-06-11 11:52:35 +1200 |
commit | d7d5934b4d71cda53cae890752c681d23ef83961 (patch) | |
tree | 834a0dd5cf3eeb1b444e6c7507df68e239e4509b /bin | |
parent | Catch ndiff(1) error condition properly (diff) | |
download | nwatch-d7d5934b4d71cda53cae890752c681d23ef83961.tar.gz nwatch-d7d5934b4d71cda53cae890752c681d23ef83961.zip |
Use explicit error codes for exit calls
Probably best not to rely on bash to carry the exit value forward
correctly; clearer this way anyway
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/nwatch | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -37,7 +37,7 @@ latest=$cachedir/${self}.scan.latest # If the cachedir doesn't exist, attempt to create it, otherwise give up if [[ ! -d "$cachedir" ]] ; then if ! mkdir -- "$cachedir" ; then - exit + exit 1 fi fi @@ -48,7 +48,7 @@ diff=$cachedir/${self}.diff.${date} # Run the scan or give up if ! nmap -v -T4 -sV -iL "$hostlist" -oA "$cache" >/dev/null ; then - exit + exit 1 fi # If the link to the XML file is legible, run the diff or give up @@ -58,7 +58,7 @@ if [[ -r ${latest}.xml ]] ; then # 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 + exit 1 fi fi |