aboutsummaryrefslogtreecommitdiff
path: root/nagios-downtime
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-06-21 13:42:05 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-06-21 13:42:05 +1200
commitbd358aed1b7ca0b01c021574986fa7e9ec2d2157 (patch)
treec6bc2e406714d9d8305a5170d6fcc9217080d96c /nagios-downtime
parentMore efficient/terser completions (diff)
downloadnagscripts-bd358aed1b7ca0b01c021574986fa7e9ec2d2157.tar.gz
nagscripts-bd358aed1b7ca0b01c021574986fa7e9ec2d2157.zip
Require at least one host
Diffstat (limited to 'nagios-downtime')
-rwxr-xr-xnagios-downtime7
1 files changed, 7 insertions, 0 deletions
diff --git a/nagios-downtime b/nagios-downtime
index fdf9988..6493dcf 100755
--- a/nagios-downtime
+++ b/nagios-downtime
@@ -81,6 +81,13 @@ case $spec in
;;
esac
+# There must be at least one object
+if ! ((${#objects[@]})) ; then
+ printf '%s: At least one host/service must be given\n' \
+ "$self" >&2
+ exit 1
+fi
+
# All the hosts or services must exist, just to be strict
for object in "${objects[@]}" ; do
nagios-exists "$object" && continue