#!/bin/sh
#
# zeroconf "plugin" for pmcheck
#

. $PCP_DIR/etc/pcp.env || exit 1
. $PCP_SHARE_DIR/lib/checkproc.sh

_do_args "$@"

if $sflag
then
    [ -d "$PCP_VAR_DIR/config/pmlogconf/zeroconf" ] && exit
    # zeroconf not installed ... provide hint
    #
    status=2
    [ "$verbose" -gt 0 ] && echo "need to install the pcp-zeroconf package"
elif $lflag
then
    [ "$verbose" -gt 0 ] && echo "Zeroconf Package"
elif $aflag
then
    if [ ! -d "$PCP_VAR_DIR/config/pmlogconf/zeroconf" ]
    then
	[ "$verbose" -gt 0 ] && echo "need to install the pcp-zeroconf package"
	status=1
    fi
elif $dflag
then
    if [ -d "$PCP_VAR_DIR/config/pmlogconf/zeroconf" ]
    then
	[ "$verbose" -gt 0 ] && echo "need to remove the pcp-zeroconf package"
	status=1
    fi
else
    [ $verbose -gt 0 ] && echo "botch sflag=$sflag aflag=$aflag dflag=$dflag show_me=$show_me verbose=$verbose"
    status=99
fi

exit
