#!/bin/bash

if [ -e @ETCDIR@/pool.conf ]; then
    if [ "$(cat @ETCDIR@/pool.conf)" = "master" ]; then
        "@BINDIR@/xe-backup-metadata" -c >/dev/null 2>&1
        EXITVALUE=$?
        if [ $EXITVALUE != 0 ]; then
             /usr/bin/logger -t backup-metadata "ALERT exited abnormally with [$EXITVALUE]"
        fi
    fi
fi

exit 0
