diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-02-09 16:26:24 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-09 16:26:24 -0200 |
commit | 11375fe3e8826e02f7a5bec1f6a2d743060dbd76 (patch) | |
tree | 427f9385f8cadc6f34c7604f09216039626203d0 /config/nrpe2/nrpe2.inc | |
parent | 703db321cd55624b1105be04ef5fad676160394f (diff) | |
download | pfsense-packages-11375fe3e8826e02f7a5bec1f6a2d743060dbd76.tar.gz pfsense-packages-11375fe3e8826e02f7a5bec1f6a2d743060dbd76.tar.bz2 pfsense-packages-11375fe3e8826e02f7a5bec1f6a2d743060dbd76.zip |
Fix nrpe2 startup script, it should fix #4391
Diffstat (limited to 'config/nrpe2/nrpe2.inc')
-rw-r--r-- | config/nrpe2/nrpe2.inc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc index c515ab99..aa2a582c 100644 --- a/config/nrpe2/nrpe2.inc +++ b/config/nrpe2/nrpe2.inc @@ -25,11 +25,19 @@ require_once('filter.inc'); -if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.0") { +$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + +if ($pfs_version == "2.0") { define('NRPE_BASE', '/usr/local'); } else { define('NRPE_BASE', '/usr/pbi/nrpe-' . php_uname("m")); } + +if ($pfs_version == "2.1") + define('NRPE_BINARY', NRPE_BASE . "sbin/nrpe2"); +else + define('NRPE_BINARY', "/usr/local/sbin/nrpe2"); + define('NRPE_CONFIG_DIR', NRPE_BASE . '/etc'); define('NRPE_RCFILE', '/usr/local/etc/rc.d/nrpe2.sh'); @@ -94,6 +102,7 @@ function nrpe2_custom_php_install_command() { ); } unlink_if_exists(NRPE_CONFIG_DIR . '/rc.d/nrpe2'); + $nrpe2_binary = NRPE_BINARY; $fd = fopen(NRPE_RCFILE, 'w'); $rc_file = <<<EOD #!/bin/sh @@ -118,9 +127,9 @@ function nrpe2_custom_php_install_command() { nrpe2_enable=\${nrpe2_enable-"YES"} name="nrpe2" -rcvar=`set_rcvar` +rcvar="\${name}" -command="{$NRPE_BASE}/sbin/nrpe2" +command="\${nrpe2_binary}" command_args="-d" extra_commands="reload" |