diff options
Diffstat (limited to 'debian/sitesummary.cron.daily')
| -rwxr-xr-x | debian/sitesummary.cron.daily | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/debian/sitesummary.cron.daily b/debian/sitesummary.cron.daily index 62b24c3..a565331 100755 --- a/debian/sitesummary.cron.daily +++ b/debian/sitesummary.cron.daily @@ -96,9 +96,19 @@ fi # Only enable if nagios v3 and sitesummary is installed. if [ -f /etc/init.d/nagios3 ] && [ -x /usr/sbin/sitesummary-nodes ]; then generate_nagios_config - if invoke-rc.d nagios3 status >/dev/null ; then - invoke-rc.d nagios3 reload >/dev/null - fi + # subshell to avoid passing all variables from + # /etc/default/nagios3 to other parts of this script + ( + if [ -r /etc/default/nagios3 ] ; then + . /etc/default/nagios3 + fi + # Only reload nagios if the sitesummary config is the active + # one and nagios3 is currently running. + if [ /etc/nagios3/sitesummary.cfg = "$NAGIOSCFG" ] && \ + invoke-rc.d nagios3 status >/dev/null ; then + invoke-rc.d nagios3 reload >/dev/null + fi + ) fi [ -d $entriesdir ] && remove_old_entries |
