#!/bin/sh

if ! grep -q master /etc/xensource/pool.conf; then
    # "Not checking certificate expiration for alerts, this is not a master host"
    exit 0
fi

/opt/xensource/libexec/alert-certificate-check >/dev/null 2>&1

EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t alert-certificate-check "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
