summaryrefslogtreecommitdiffstats
path: root/Reaktor/commands/nag
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-08-11 21:41:42 +0200
committertv <tv@shackspace.de>2014-08-11 21:41:42 +0200
commitb62400bcfa8f5551ea8c3ef7c5f2aecf008bd7f0 (patch)
tree54b8011408b4a299aa743983c2ebbe308cb3316b /Reaktor/commands/nag
parentbace29e195f728d9fcc31932913833ea31d8e531 (diff)
Reaktor nag: add support for service inspection
Diffstat (limited to 'Reaktor/commands/nag')
-rwxr-xr-xReaktor/commands/nag17
1 files changed, 16 insertions, 1 deletions
diff --git a/Reaktor/commands/nag b/Reaktor/commands/nag
index e552e11c..fabeec8d 100755
--- a/Reaktor/commands/nag
+++ b/Reaktor/commands/nag
@@ -35,17 +35,32 @@ diff -u nag.hosts.ls nag.services.ls > nag.patch || :
missing_services=$(sed -n '1d;2d;s/^-\(.*\)/\1/p' nag.patch | tr '\n' ' ')
obsolete_services=$(sed -n '1d;2d;s/^+\(.*\)/\1/p' nag.patch | tr '\n' ' ')
+if test "${inspect_services-false}" = true; then
+ missing_owners=$(set +f; cd nag.services && grep '^owner:$' * | cut -d: -f1)
+ missing_mailtos=$(set +f; cd nag.services && grep '^mailto:$' * | cut -d: -f1)
+fi
#
# output
#
+did_nag=false
if test -n "$missing_services"; then
echo missing services: $missing_services
+ did_nag=true
fi
if test -n "$obsolete_services"; then
echo obsolete services: $obsolete_services
+ did_nag=true
+fi
+if test -n "${missing_owners-}"; then
+ echo services with missing owner entry: $missing_owners
+ did_nag=true
+fi
+if test -n "${missing_mailtos-}"; then
+ echo services with missing mailto entry: $missing_mailtos
+ did_nag=true
fi
# if asked directly, answer if there is nothing to nag about
-if test -z "$missing_services$obsolete_services" -a -n "${_from:-}";then
+if test $did_nag = false -a -n "${_from:-}";then
echo "nothing to nag about"
fi