#!/bin/sh -e

export LANG=C
P=`dirname $0`

$P/ngreconfig.py $P/extinfo $P/hostextinfo.cfg

if [ ! "$1" == "" ]; then
  # extinfo only
  exit 0
fi

$P/ngreconfig.py $P/main $P/main.cfg

if [ -f w3sa-update.py ]; then
  python w3sa-update.py > w3sa.cfg
fi

/usr/sbin/nagios -v $P/nagios.cfg

/sbin/service nagios reload
