diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2005-05-19 15:56:37 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2005-05-19 15:56:37 +0000 |
commit | 1f8dc94f2ec9d416533d88932c6019b789396ea5 (patch) | |
tree | 8ba88424701a20eb280f10f1ccbd8995a45e086a /net-mgmt/nagios2 | |
parent | 663c189ac6335c308d8e6b115e192c6c317df761 (diff) | |
download | ports-1f8dc94f2ec9d416533d88932c6019b789396ea5.tar.gz ports-1f8dc94f2ec9d416533d88932c6019b789396ea5.zip |
Notes
Diffstat (limited to 'net-mgmt/nagios2')
-rw-r--r-- | net-mgmt/nagios2/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/nagios2/files/nagios.sh.tmpl | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/net-mgmt/nagios2/Makefile b/net-mgmt/nagios2/Makefile index e4f68de1cdeb..1f235bb80a1d 100644 --- a/net-mgmt/nagios2/Makefile +++ b/net-mgmt/nagios2/Makefile @@ -7,6 +7,7 @@ PORTNAME= nagios PORTVERSION= 2.0.b3 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=nagios diff --git a/net-mgmt/nagios2/files/nagios.sh.tmpl b/net-mgmt/nagios2/files/nagios.sh.tmpl index 5355f3c382b7..137deebbe9a8 100644 --- a/net-mgmt/nagios2/files/nagios.sh.tmpl +++ b/net-mgmt/nagios2/files/nagios.sh.tmpl @@ -34,14 +34,30 @@ nagios_user=%%NAGIOSUSER%% start_precmd=start_precmd stop_postcmd=stop_postcmd +restart_precmd=nagios_checkconfig # set defaults nagios_enable=${nagios_enable:-"NO"} nagios_flags=${nagios_flags:-""} +nagios_checkconfig() +{ + echo -n 'Performing sanity check on Nagios configuration: ' + $NagiosBin -v $NagiosCfg > /dev/null 2>&1 + if [ $? != 0 ]; then + echo 'FAILED.' + echo "Use '$NagiosBin -v $NagiosCfg' command for details." + return 1 + else + echo 'OK.' + fi +} + start_precmd() { + nagios_checkconfig; [ $? != 0 ] && return 1 + su -m ${nagios_user} -c "touch ${NagiosVar}/nagios.log ${NagiosSav}" rm -f ${NagiosCmd} } |