]> git.michaelhowe.org Git - packages/n/nagios-plugins-local.git/commitdiff
Fx bash syntax in check_newaliases
authorMichael Howe <michael@michaelhowe.org>
Mon, 25 Dec 2023 15:42:49 +0000 (15:42 +0000)
committerMichael Howe <michael@michaelhowe.org>
Mon, 25 Dec 2023 15:42:49 +0000 (15:42 +0000)
debian/changelog
plugins/check_newaliases

index 02bda5f01ad39183317c4cd4cf4e8b4c53fc3749..cbc872ffaea7c9cf94f6a80ce6fa7003878f77a4 100644 (file)
@@ -1,3 +1,9 @@
+nagios-plugins-local (0.29) unstable; urgency=medium
+
+  * Correct bash syntax in check_newaliases 
+
+ -- Michael Howe <michael@michaelhowe.org>  Mon, 25 Dec 2023 15:28:45 +0000
+
 nagios-plugins-local (0.28) unstable; urgency=medium
 
   * Add check_json from https://github.com/RustyDust/check_json/ 
index c8396f2d6457abb80710e1e4851051d4c2a61205..7d6236b7150afc0a7eaa24883a13e6553892a8a2 100755 (executable)
@@ -18,7 +18,7 @@ ALIASDB_FILE=${ALIAS_FILE}.db
 TARGET=$(readlink -f $NEWALIASES)
 
 if [ "$TARGET" != "$REQUIRED_TARGET" ]; then
-    echo "ALIASES OK - Looks like we're not running postfix (newaliases points to ${TARGET})"
+    echo "ALIASES OK - Not running postfix (newaliases points to ${TARGET})"
     exit
 fi
 
@@ -27,8 +27,9 @@ ALIASDB_TS=$(stat --format %Y $ALIASDB_FILE)
 
 sec=$((ALIASDB_TS - ALIAS_TS))
 
-if [ $sec > 0 ]; then
+if [ $sec -gt 0 ]; then
     echo "ALIASES OK - aliases.db is ${sec}s newer than aliases"
+    exit 0
 else
     echo "ALIASES CRITICAL - aliases.db is ${sec}s older than aliases"
     exit 2