aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/bacula-client/bacula-client.inc182
-rw-r--r--config/bacula-client/bacula-client.xml115
-rw-r--r--config/bacula-client/bacula-client_fd.xml96
-rw-r--r--config/bacula-client/bacula-client_view_config.php58
-rw-r--r--config/bandwidthd/bandwidthd.inc422
-rw-r--r--config/bandwidthd/bandwidthd.xml308
-rw-r--r--config/open-vm-tools_2/open-vm-tools.inc76
-rw-r--r--config/open-vm-tools_2/open-vm-tools.xml98
-rw-r--r--config/phpservice/phpservice.inc223
-rw-r--r--config/phpservice/phpservice.xml127
-rw-r--r--config/phpservice/phpservice_php.php151
-rw-r--r--config/phpservice/phpservice_php.tmp192
-rw-r--r--config/phpservice/phpservice_php_edit.php180
-rw-r--r--config/phpservice/phpservice_php_edit.tmp225
-rw-r--r--config/routed/routed.inc102
-rw-r--r--config/routed/routed.xml92
-rw-r--r--pkg_config.10.xml10
17 files changed, 1274 insertions, 1383 deletions
diff --git a/config/bacula-client/bacula-client.inc b/config/bacula-client/bacula-client.inc
index 8a04d55b..07be3067 100644
--- a/config/bacula-client/bacula-client.inc
+++ b/config/bacula-client/bacula-client.inc
@@ -1,128 +1,118 @@
<?php
-
-/* ========================================================================== */
-/*
- bacula-client.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2012 Marcio Carlos Braga Antao
- Copyright (C) 2012-2013 Marcello Coutinho
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code MUST retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form MUST reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- require_once("config.inc");
- require_once("util.inc");
-
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version > 2.0)
+ bacula-client.inc
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2012 Marcio Carlos Braga Antao
+ Copyright (C) 2012-2013 Marcello Coutinho
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+require_once("config.inc");
+require_once("util.inc");
+
+$pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
+if ($pf_version == "2.1" || $pf_version == "2.2") {
define('BACULA_LOCALBASE', '/usr/pbi/bacula-' . php_uname("m"));
-else
+} else {
define('BACULA_LOCALBASE','/usr/local');
-
+}
define('BACULA_STARTUP_SCRIPT', '/usr/local/etc/rc.d/bacula-fd.sh');
-function baculaclient_custom_php_install_command(){
- global $g, $config;
+function baculaclient_custom_php_install_command() {
baculaclient_custom_php_write_config();
}
function baculaclient_custom_php_deinstall_command(){
- global $g, $config;
-
conf_mount_rw();
- // 1. Delete our config file
- unlink_if_exists(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf");
+ // Delete our config file
+ unlink_if_exists(BACULA_LOCALBASE . "/etc/bacula/bacula-fd.conf");
+ // Stop service and delete our rc file
+ stop_service("bacula-client");
+ unlink_if_exists(BACULA_STARTUP_SCRIPT);
- // 2. Re-run sshd config generation script
- exec(BACULA_STARTUP_SCRIPT . " stop");
conf_mount_ro();
}
function baculaclient_custom_php_write_config(){
- global $g, $config;
+ global $config, $LocalDirector;
conf_mount_rw();
- //check config_file
- $startup_file=BACULA_LOCALBASE . "/etc/rc.d/bacula-fd";
- if (file_exists($startup_file)){
- $startup_script=file_get_contents($startup_file);
- $startup_script=preg_replace("/NO/","YES",$startup_script);
- $startup_script=preg_replace("@/usr/local/etc/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$startup_script);
- $startup_script=preg_replace("@/usr/local/etc/bacula/bacula-fd.conf@",BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$startup_script);
- file_put_contents(BACULA_STARTUP_SCRIPT,$startup_script,LOCK_EX);
- // Ensure bacula-fd has a+rx
- exec("chmod a+rx " . BACULA_STARTUP_SCRIPT);
- }
- //check config
- if (is_array($config['installedpackages']['baculaclient']['config'])){
+ // Check config_file
+ $startup_file = BACULA_LOCALBASE . "/etc/rc.d/bacula-fd";
+ if (file_exists($startup_file)) {
+ $startup_script = file_get_contents($startup_file);
+ $startup_script = preg_replace("/NO/","YES", $startup_script);
+ $startup_script = preg_replace("@/usr/local/etc/bacula-fd.conf@", BACULA_LOCALBASE . "/etc/bacula/bacula-fd.conf", $startup_script);
+ $startup_script = preg_replace("@/usr/local/etc/bacula/bacula-fd.conf@", BACULA_LOCALBASE . "/etc/bacula/bacula-fd.conf", $startup_script);
+ file_put_contents(BACULA_STARTUP_SCRIPT, $startup_script, LOCK_EX);
+ // Ensure bacula-fd is executable
+ chmod(BACULA_STARTUP_SCRIPT, 0755);
+ }
+
+ // Check config
+ if (is_array($config['installedpackages']['baculaclient']['config'])) {
$baculaclient_conf="";
foreach ($config['installedpackages']['baculaclient']['config'] as $bc) {
- // create Director
- switch ($bc['type']){
- case "Director":
- $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n";
- Break;
- case "Monitor":
- $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n";
- break;
- case "Local":
- $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n";
- $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n";
- $LocalDirector = $bc['director'];
- }
-
+ // Create Director
+ switch ($bc['type']) {
+ case "Director":
+ $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n";
+ break;
+ case "Monitor":
+ $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n";
+ break;
+ case "Local":
+ $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n";
+ $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n";
+ $LocalDirector = $bc['director'];
}
- // create Messages
+ }
+
+ // Create Messages
if (!empty($LocalDirector)) {
$baculaclient_conf .= "Messages { \n\tName = Standard \n\tdirector = {$LocalDirector}-dir = all, !skipped, !restored\n}\n";
}
- // create FielDaemon
-
- if (is_array($config['installedpackages']['baculaclientfd']['config'])){
- $port = $config['installedpackages']['baculaclientfd']['config'][0]['port'];
- $jobs = $config['installedpackages']['baculaclientfd']['config'][0]['jobs'];
- }
- else{
- $port="9102";
- $jobs="20";
- }
+ // Create FileDaemon
+ if (is_array($config['installedpackages']['baculaclientfd']['config'])) {
+ $port = $config['installedpackages']['baculaclientfd']['config'][0]['port'] ?: '9102';
+ $jobs = $config['installedpackages']['baculaclientfd']['config'][0]['jobs'] ?: '20';
+ }
if (!empty($LocalDirector)) {
$baculaclient_conf .= "FileDaemon { \n\tName = {$LocalDirector}-fd #\n\tFDport = {$port}\n\tWorkingDirectory = /var/db/bacula\n\tPid Directory = /var/run\n\tMaximum Concurrent Jobs = {$jobs}\n}\n";
}
- file_put_contents(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$baculaclient_conf,LOCK_EX);
- exec(BACULA_STARTUP_SCRIPT . " restart");
- // Mount Read-only
- conf_mount_ro();
+ // Write config file and start service
+ file_put_contents(BACULA_LOCALBASE . "/etc/bacula/bacula-fd.conf", $baculaclient_conf, LOCK_EX);
+ if (!empty($LocalDirector)) {
+ restart_service("bacula-client");
+ } else {
+ log_error("[bacula-client] You need at least one local Director in order to run bacula-client.");
}
- }
- ?>
+ conf_mount_ro();
+ }
+}
+?>
diff --git a/config/bacula-client/bacula-client.xml b/config/bacula-client/bacula-client.xml
index 65b5231e..ce07e77e 100644
--- a/config/bacula-client/bacula-client.xml
+++ b/config/bacula-client/bacula-client.xml
@@ -1,81 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
-<copyright>
- <![CDATA[
+ <copyright>
+<![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- bacula-client.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) Marcio Carlos Braga Antao
- Copyright (C) 2012 Marcello Coutinho
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
+ bacula-client.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) Marcio Carlos Braga Antao
+ Copyright (C) 2012 Marcello Coutinho
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Client Install for Bacula 5.2.6 Backup</description>
- <requirements>Bacula Server Installed in or network</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
+ <requirements>Bacula Server Installed on your network.</requirements>
<name>baculaclient</name>
- <version>5.2.6</version>
- <title>Bacula-Client: Setting</title>
- <aftersaveredirect>/pkg.php?xml=bacula-client.xml</aftersaveredirect>
+ <version>1.0.8</version>
+ <title>Bacula Client: Settings</title>
+ <aftersaveredirect>/pkg.php?xml=bacula-client.xml</aftersaveredirect>
<include_file>/usr/local/pkg/bacula-client.inc</include_file>
<configpath>installedpackages->package->baculaclient</configpath>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
<item>https://packages.pfsense.org/packages/config/bacula-client/bacula-client.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
<item>https://packages.pfsense.org/packages/config/bacula-client/bacula-client_fd.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
<item>https://packages.pfsense.org/packages/config/bacula-client/bacula-client_view_config.php</item>
</additional_files_needed>
<menu>
- <name>Bacula-client</name>
- <tooltiptext>bacula backup client</tooltiptext>
+ <name>Bacula Client</name>
+ <tooltiptext>Bacula Backup Client</tooltiptext>
<section>Services</section>
<configfile>bacula-client.xml</configfile>
</menu>
<service>
<rcfile>bacula-fd.sh</rcfile>
- <name>Bacula-client</name>
+ <name>bacula-client</name>
<executable>bacula-fd</executable>
- <description>bacula backup client</description>
+ <description>Bacula Backup Client</description>
</service>
<tabs>
<tab>
@@ -104,20 +100,20 @@
<columnitem>
<fielddescr>Description</fielddescr>
<fieldname>description</fieldname>
- </columnitem>
+ </columnitem>
</adddeleteeditpagefields>
<fields>
<field>
<type>listtopic</type>
<fieldname>directors</fieldname>
<name>Directors</name>
- </field>
+ </field>
<field>
<fielddescr>Director Name</fielddescr>
<fieldname>director</fieldname>
<type>input</type>
<size>60</size>
- <description>Name of director</description>
+ <description>Enter name for the Director.</description>
<required/>
</field>
<field>
@@ -132,7 +128,7 @@
<fieldname>password</fieldname>
<type>password</type>
<size>30</size>
- <description><![CDATA[Enter password for Director use to Access.]]></description>
+ <description>Enter password used for Director access.</description>
</field>
<field>
<fielddescr>Director type</fielddescr>
@@ -143,20 +139,17 @@
<option><name>Local</name><value>Local</value></option>
<option><name>Monitor</name><value>Monitor</value></option>
</options>
- <description>Director Type. You need at least one local director.</description>
+ <description>
+ <![CDATA[
+ Select director type.<br />
+ <strong>NOTE: You need at least one local Director.</strong>
+ ]]>
+ </description>
</field>
</fields>
<custom_php_install_command>
baculaclient_custom_php_install_command();
</custom_php_install_command>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_php_validation_command>
- </custom_php_validation_command>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_add_php_command>
- </custom_add_php_command>
<custom_php_resync_config_command>
baculaclient_custom_php_write_config();
</custom_php_resync_config_command>
diff --git a/config/bacula-client/bacula-client_fd.xml b/config/bacula-client/bacula-client_fd.xml
index 08a64ea1..aed6d7b6 100644
--- a/config/bacula-client/bacula-client_fd.xml
+++ b/config/bacula-client/bacula-client_fd.xml
@@ -1,53 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <copyright>
- <![CDATA[
+ <copyright>
+<![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- bacula-client_df.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2012 Marcio Carlos Braga Antao
- Copyright (C) 2012 Marcello Coutinho
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
+ bacula-client.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) Marcio Carlos Braga Antao
+ Copyright (C) 2012 Marcello Coutinho
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Client Install for Bacula 5.2.6 Backup</description>
- <requirements>Bacula Server Installed in or network</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
+ <requirements>Bacula Server Installed on your network.</requirements>
<name>baculaclientfd</name>
- <version>5.2.6</version>
- <title>Bacula-Client: FileDaemon Setting</title>
- <aftersaveredirect>/pkg_edit.php?xml=bacula-client_fd.xml</aftersaveredirect>
+ <version>1.0.8</version>
+ <title>Bacula Client: FileDaemon Settings</title>
+ <aftersaveredirect>/pkg_edit.php?xml=bacula-client_fd.xml</aftersaveredirect>
<include_file>/usr/local/pkg/bacula-client.inc</include_file>
<configpath>installedpackages->package->baculaclient</configpath>
<tabs>
@@ -76,7 +75,7 @@
<fieldname>port</fieldname>
<type>input</type>
<size>4</size>
- <description>Port for a File Daemon. Default : 9102 </description>
+ <description>Port for a File Daemon. (Default: 9102)</description>
<required/>
</field>
<field>
@@ -85,23 +84,14 @@
<type>input</type>
<size>3</size>
<required/>
- <description>Maximum Concurrent Jobs. Default : 20</description>
+ <description>Maximum Concurrent Jobs. (Default: 20)</description>
</field>
</fields>
-
<custom_php_install_command>
baculaclient_custom_php_install_command();
</custom_php_install_command>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_php_validation_command>
- </custom_php_validation_command>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_add_php_command>
- </custom_add_php_command>
<custom_php_resync_config_command>
- baculaclient_custom_php_write_config();
+ baculaclient_custom_php_write_config();
</custom_php_resync_config_command>
</packagegui>
diff --git a/config/bacula-client/bacula-client_view_config.php b/config/bacula-client/bacula-client_view_config.php
index 28098965..c10a0cda 100644
--- a/config/bacula-client/bacula-client_view_config.php
+++ b/config/bacula-client/bacula-client_view_config.php
@@ -1,9 +1,9 @@
<?php
/*
bacula-client_view_config.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2012 M�rcio Carlos Ant�o
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2012 Marcio Carlos Braga Antao
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -27,33 +27,26 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
require("guiconfig.inc");
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-if ($pf_version > 2.0)
+$$pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
+if ($pf_version == "2.1" || $pf_version == "2.2") {
define('BACULA_LOCALBASE', '/usr/pbi/bacula-' . php_uname("m"));
-else
+} else {
define('BACULA_LOCALBASE','/usr/local');
+}
$pgtitle = "Bacula-Client: View Configuration";
include("head.inc");
?>
+
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-<?php endif; ?>
-
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="bacula-client_view_config.php" method="post">
-
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
@@ -65,27 +58,24 @@ include("head.inc");
display_top_tabs($tab_array);
?>
</td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
- <textarea id="varnishlogs" rows="50" cols="87%">
-<?php
- $config_file = file_get_contents(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf");
- echo $config_file;
-?>
- </textarea>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
+ <tr><td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td class="tabcont">
+ <textarea id="varnishlogs" rows="50" cols="87%">
+ <?php
+ $config_file = file_get_contents(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf");
+ echo $config_file;
+ ?>
+ </textarea>
+ </td></tr>
+ </table>
+ </div>
+ </td></tr>
</table>
</div>
</form>
+
<?php include("fend.inc"); ?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index b57b2732..9364cbbc 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -1,9 +1,11 @@
<?php
-/* $Id$ */
/*
bandwidthd.inc
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2006 Scott Ullrich
- part of pfSense
+ Copyright (C) 2009 Bill Marquette
+ Copyright (C) 2012-2013 Phil Davis
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -27,181 +29,92 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
-// Check pfSense version
-$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
switch ($pfs_version) {
- case "2.1":
- define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd');
- define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
- break;
- case "2.2":
- define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/local/bandwidthd');
- define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', 'LD_LIBRARY_PATH=/usr/pbi/bandwidthd-' . php_uname("m") . '/local/lib');
- break;
- default:
- define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd');
- define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
- }
-// End: Check pfSense version
-
-function is_blank($value) {
- return empty($value) && !is_numeric($value);
+ case "2.1":
+ define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
+ break;
+ case "2.2":
+ define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/local/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', 'LD_LIBRARY_PATH=/usr/pbi/bandwidthd-' . php_uname("m") . '/local/lib');
+ break;
+ default:
+ define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd');
+ define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', '');
}
function bandwidthd_install_deinstall() {
conf_mount_rw();
- exec("rm -f /usr/local/etc/rc.d/bandwidthd*");
- exec("rm -rf " . PKG_BANDWIDTHD_BASE . "/htdocs");
- exec("rm -f /usr/local/www/bandwidthd");
+ stop_service("bandwidthd");
+ mwexec("/bin/rm -rf " . PKG_BANDWIDTHD_BASE . "/htdocs");
+ mwexec("/bin/rm -f /usr/local/www/bandwidthd");
// Remove the cron job, if it is there
install_cron_job("/bin/kill -HUP `cat /var/run/bandwidthd.pid`", false);
conf_mount_ro();
}
function bandwidthd_install_config() {
- global $config, $g;
+ global $config, $g, $bandwidthd_config;
+ conf_mount_rw();
/* bandwidthd doesn't have a way to pass a custom config path, unfortunately */
- /* the conf file must be ./etc/bandwidthd.conf relative to the current dir */
+ /* So, the .conf file must be ./etc/bandwidthd.conf relative to the current dir */
$bandwidthd_base_dir = PKG_BANDWIDTHD_BASE;
$bandwidthd_config_dir = PKG_BANDWIDTHD_BASE . "/etc";
$bandwidthd_runtime_library_env = PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV;
- conf_mount_rw();
-
- /* user defined values */
+ /* General Options */
$bandwidthd_config = $config['installedpackages']['bandwidthd']['config'][0];
- $meta_refresh = $bandwidthd_config['meta_refresh'];
- if (is_numeric($meta_refresh))
- $meta_refresh = "meta_refresh $meta_refresh\n";
- else
- $meta_refresh = "";
-
- $graph = $bandwidthd_config['drawgraphs'];
- if ($graph)
- $graph = "graph true\n";
- else
- $graph = "graph false\n";
-
- $filter_text = $bandwidthd_config['filter'];
- if (!is_blank($filter_text))
- $filter_text = "filter $filter_text\n";
- else
- $filter_text = "";
-
- $recover_cdf = $bandwidthd_config['recovercdf'];
- if ($recover_cdf)
- $recover_cdf = "recover_cdf true\n";
- else
- $recover_cdf = "";
-
- $output_cdf = $bandwidthd_config['outputcdf'];
- if ($output_cdf)
- $output_cdf_string = "output_cdf true\n";
- else
- $output_cdf_string = "";
-
- $output_postgresql = $bandwidthd_config['outputpostgresql'];
- $postgresql_host = $bandwidthd_config['postgresqlhost'];
- $postgresql_database = $bandwidthd_config['postgresqldatabase'];
- $postgresql_username = $bandwidthd_config['postgresqlusername'];
- $postgresql_password = $bandwidthd_config['postgresqlpassword'];
- $postgresql_string = "";
- if ($output_postgresql) {
- if (!is_blank($postgresql_host) && !is_blank($postgresql_username) && !is_blank($postgresql_database) && !is_blank($postgresql_password))
- $postgresql_string = "pgsql_connect_string \"user = $postgresql_username dbname = $postgresql_database password = $postgresql_password host = $postgresql_host\"\n";
- else
- log_error("bandwidthd: You have to specify the postgreSQL Host, Database, Username and Password. postgreSQL details have been ignored.");
- }
-
- $sensor_id = $bandwidthd_config['sensorid'];
-
- if (!is_blank($sensor_id))
- $sensor_id_string = "sensor_id \"$sensor_id\"";
- else
- $sensor_id_string = "";
-
- $promiscuous = $bandwidthd_config['promiscuous'];
- if ($promiscuous)
- $promiscuous = "promiscuous true\n";
- else
- $promiscuous = "promiscuous false\n";
-
- $graph_cutoff = $bandwidthd_config['graphcutoff'];
- if (!is_blank($graph_cutoff))
- $graph_cutoff = "graph_cutoff $graph_cutoff\n";
- else
- $graph_cutoff = "";
-
- $skip_intervals = $bandwidthd_config['skipintervals'];
- if ($skip_intervals) {
- $skip_intervals = "skip_intervals $skip_intervals\n";
- } else {
- /* Includes the case where 0 is explicitly specified, which is the default anyway. */
- $skip_intervals = "";
- }
-
- if (!is_blank($bandwidthd_config['active_interface'])){
- $ifdescrs = array($bandwidthd_config['active_interface']);
- } else {
- log_error("You should specify an interface for bandwidthd to listen on. Exiting.");
+ /* Configure bandwidthd web interface */
+ $dev = "";
+ $ifdescrs = array($bandwidthd_config['active_interface']);
+ foreach ($ifdescrs as $ifdescr) {
+ $descr = convert_friendly_interface_to_real_interface_name($ifdescr);
+ $dev .= "dev \"{$descr}\"\n";
}
-
- $subnets_custom = explode(';',str_replace(' ','',$bandwidthd_config['subnets_custom']));
-
- /* initialize to "" */
+ /* Configure stats interface(s) */
$subnets = "";
- //$ifdescrs = array("lan", "wan");
- //for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- //$ifdescrs['opt' . $j] = "opt" . $j;
- //}
- if (is_array($ifdescrs)) {
- foreach ($ifdescrs as $int) {
- /* calculate interface subnet information */
- $ifcfg = $config['interfaces'][$int];
- $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
- $subnetmask = gen_subnet_mask($ifcfg['subnet']);
- $subnet_with_mask = "";
- if ($subnet == "pppoe") {
- $subnet = find_interface_ip("ng0");
- if ($subnet) {
- $subnet_with_mask = $subnet . "/32";
- }
- } else {
- if ($subnet) {
- $subnet_with_mask = $subnet . "/" . $ifcfg['subnet'];
- }
- }
- if (!empty($subnet_with_mask)) {
- /* Only add the subnet if the user has not specified it in the custom subnets. */
- /* This avoids generating an unnecessary syntax error message from the config. */
- if (!in_array($subnet_with_mask, $subnets_custom))
- $subnets .= "subnet {$subnet_with_mask}\n";
- }
+ $stats_interfaces = $bandwidthd_config['interface_array'] ?: 'lan';
+ foreach ($stats_interfaces as $iface) {
+ if (is_ipaddr(get_interface_ip($iface))) {
+ $subnets .= "subnet " . gen_subnet(get_interface_ip($iface),get_interface_subnet($iface)) . "/" . get_interface_subnet($iface) . "\n";
}
}
-
- if (is_array($subnets_custom)) {
- foreach ($subnets_custom as $sub) {
- if (!empty($sub) && is_subnet($sub))
- $subnets .= "subnet {$sub}\n";
- }
+ $promiscuous_val = ($bandwidthd_config['promiscuous'] != "" ? "promiscuous true" : "promiscuous false");
+ $sensor_id_string_val = ($bandwidthd_config['sensorid'] != "" ? "sensor_id \"{$bandwidthd_config['sensorid']}\"" : "");
+
+ /* Graphs Options */
+ $graph_val = ($bandwidthd_config['drawgraphs'] != "" ? "graph true" : "graph false");
+ $meta_refresh_val = ($bandwidthd_config['meta_refresh'] != "" ? "meta_refresh {$bandwidthd_config['meta_refresh']}" : "");
+ $skip_intervals_val = ($bandwidthd_config['skipintervals'] != "" ? "skip_intervals {$bandwidthd_config['skipintervals']}" : "");
+ $graph_cutoff_val = ($bandwidthd_config['graphcutoff'] != "" ? "graph_cutoff {$bandwidthd_config['graphcutoff']}" : "");
+ $output_cdf_val = ($bandwidthd_config['outputcdf'] != "" ? "output_cdf true" : "");
+ $recover_cdf_val = ($bandwidthd_config['recovercdf'] != "" ? "recover_cdf true" : "");
+
+ /* PostgreSQL Options */
+ if ($bandwidthd_config['outputpostgresql']) {
+ $postgresql_host = $bandwidthd_config['postgresqlhost'];
+ $postgresql_database = $bandwidthd_config['postgresqldatabase'];
+ $postgresql_username = $bandwidthd_config['postgresqlusername'];
+ $postgresql_password = base64_decode($bandwidthd_config['postgresqlpasswordenc']);
+ $postgresql_string_val = "pgsql_connect_string \"user = $postgresql_username dbname = $postgresql_database password = $postgresql_password host = $postgresql_host\"\n";
+ } else {
+ $postgresql_string_val = "";
}
- /* initialize to "" */
- $dev = "";
- if (is_array($ifdescrs)) {
- foreach ($ifdescrs as $ifdescr) {
- $descr = convert_friendly_interface_to_real_interface_name($ifdescr);
- $dev .= "dev \"$descr\"\n";
- }
+ /* Advanced Filter */
+ if ($bandwidthd_config['advfilter']) {
+ $filter_text_val = "filter " . escapeshellarg(base64_decode($bandwidthd_config['advfilter']));
+ } else {
+ $filter_text_val = "";
}
+ /* Write out the config file */
$config_file = <<<EOF
#
# This file was automatically generated by the pfSense
-# package management system. Changing this file
+# package management system. Changing this file
# will lead to it being overwritten again when
# the package manager resyncs.
#
@@ -211,62 +124,62 @@ function bandwidthd_install_config() {
# Commented out options are here to provide
# documentation and represent defaults
-# Subnets to collect statistics on. Traffic that
+# Subnets to collect statistics on. Traffic that
# matches none of these subnets will be ignored.
# Syntax is either IP Subnet Mask or CIDR
-$subnets
+{$subnets}
# Device to listen on
# Bandwidthd listens on the first device it detects
-# by default. Run "bandwidthd -l" for a list of
+# by default. Run "bandwidthd -l" for a list of
# devices.
-$dev
+{$dev}
###################################################
# Options that don't usually get changed
# An interval is 2.5 minutes, this is how many
# intervals to skip before doing a graphing run
-$skip_intervals
+{$skip_intervals_val}
# Graph cutoff is how many k must be transferred by an
# ip before we bother to graph it
-$graph_cutoff
+{$graph_cutoff_val}
#Put interface in promiscuous mode to score to traffic
#that may not be routing through the host machine.
-$promiscuous
+{$promiscuous_val}
#Log data to cdf file htdocs/log.cdf
-$output_cdf_string
+{$output_cdf_val}
#Read back the cdf file on startup
-$recover_cdf
+{$recover_cdf_val}
# Standard postgres connect string, just like php, see postgres docs for
# details
-$postgresql_string
+{$postgresql_string_val}
# Arbitrary sensor name, I recommend the sensors fully qualified domain
# name
-$sensor_id_string
+{$sensor_id_string_val}
#Libpcap format filter string used to control what bandwidthd sees
#Please always include "ip" in the string to avoid strange problems
-$filter_text
+{$filter_text_val}
#Draw Graphs - This defaults to true to graph the traffic bandwidthd is recording
#Usually set this to false if you only want cdf output or
-#you are using the database output option. Bandwidthd will use very little
+#you are using the database output option. Bandwidthd will use very little
#ram and cpu if this is set to false.
-$graph
+{$graph_val}
#Set META REFRESH seconds (default 150, use 0 to disable).
-$meta_refresh
+{$meta_refresh_val}
EOF;
- $fd = fopen("{$bandwidthd_config_dir}/bandwidthd.conf","w");
+ $fd = fopen("{$bandwidthd_config_dir}/bandwidthd.conf", "w");
if (!$fd) {
log_error("could not open {$bandwidthd_config_dir}/bandwidthd.conf for writing");
exit;
@@ -274,13 +187,12 @@ EOF;
fwrite($fd, $config_file);
fclose($fd);
+ /* nanobsd hacks */
if ($g['platform'] == 'nanobsd') {
$bandwidthd_nano_dir = "/var/bandwidthd";
$bandwidthd_htdocs_dir = $bandwidthd_nano_dir . "/htdocs";
if (!is_dir($bandwidthd_nano_dir)) {
- if (file_exists($bandwidthd_nano_dir)) {
- unlink($bandwidthd_nano_dir);
- }
+ unlink_if_exists($bandwidthd_nano_dir);
mkdir($bandwidthd_nano_dir);
}
} else {
@@ -289,24 +201,19 @@ EOF;
$rc = array();
$rc['file'] = 'bandwidthd.sh';
- $rc['stop'] = <<<EOD
-/usr/bin/killall bandwidthd
-EOD;
+ $rc['stop'] = '/usr/bin/killall bandwidthd';
- // If this is an old config before the enable checkbox was added, then enable by default
- $bandwidthd_enable = (!isset($bandwidthd_config['enable']) || ($bandwidthd_config['enable']));
- if ($bandwidthd_enable) {
+ if ($bandwidthd_config['enable']) {
if ($g['platform'] == 'nanobsd') {
- // On nanobsd, /var/bandwidthd is created.
- // In that is a real /var/bandwidth/htdocs, where the graph data is written
- // A soft link to the real bandwidth program is made - /var/bandwidthd/bandwidthd
- // A soft link to the etc folder with the conf file is made - /var/bandwidthd/etc
- // bandwidthd is started from /var/bandwidthd with the current dir /var/bandwidth
- // This way, it:
- // looks in ./etc for the conf file
- // writes graph files in ./htdocs
- // writes cdf log files (if selected in the config) to ./
- // All of this is on the /var filesystem, which is a read-write memory disk on nanobsd
+ /* On nanobsd:
+ * first, /var/bandwidthd is created, with real /var/bandwidth/htdocs inside, where the graph data is written;
+ * soft link to the real bandwidth program is made - /var/bandwidthd/bandwidthd;
+ * soft link to the etc folder with the conf file is made - /var/bandwidthd/etc;
+ * bandwidthd is started from /var/bandwidthd with the current dir /var/bandwidth.
+ * This way, it looks in ./etc for the conf file, writes graph files in ./htdocs
+ * writes cdf log files (if selected in the config) to ./
+ * All of these are on the /var filesystem, which is a read-write memory disk on nanobsd */
+
$rc['start'] = <<<EOD
if [ ! -d "{$bandwidthd_nano_dir}" ] ; then
if [ -e "{$bandwidthd_nano_dir}" ] ; then
@@ -355,21 +262,17 @@ EOD;
$rc['start'] = "return";
}
- /* write out rc.d start/stop file */
+ /* Write out rc.d file */
write_rcfile($rc);
if (!is_dir($bandwidthd_htdocs_dir)) {
- if (file_exists($bandwidthd_htdocs_dir)) {
- unlink($bandwidthd_htdocs_dir);
- }
- mkdir($bandwidthd_htdocs_dir);
+ unlink_if_exists($bandwidthd_htdocs_dir);
+ safe_mkdir($bandwidthd_htdocs_dir);
}
+
$bandwidthd_www_link = $g["www_path"] . "/bandwidthd";
if (!is_link($bandwidthd_www_link)) {
- if (file_exists($bandwidthd_www_link)) {
- // It is a file and not a link - clean it up.
- unlink($bandwidthd_www_link);
- }
+ unlink_if_exists($bandwidthd_www_link);
symlink($bandwidthd_htdocs_dir, $bandwidthd_www_link);
}
@@ -378,19 +281,138 @@ EOD;
exec("echo \"Please start bandwidthd to populate this directory.\" > " . $bandwidthd_index_file);
}
- if (($bandwidthd_enable) && ($output_cdf)) {
+ /* Cron job for graphs */
+ if (($bandwidthd_config['enable']) && ($output_cdf)) {
// Use cron job to rotate logs every day at 00:01
install_cron_job("/bin/kill -HUP `cat /var/run/bandwidthd.pid`", true, "1", "0");
- }
- else
- {
- // Remove the cron job, if it is there
+ } else {
+ // Remove the cron job if it is there
install_cron_job("/bin/kill -HUP `cat /var/run/bandwidthd.pid`", false);
}
+
conf_mount_ro();
- stop_service("bandwidthd");
- if ($bandwidthd_enable) {
- start_service("bandwidthd");
+
+ /* Restart the service if enabled; otherwise stop it */
+ if ($bandwidthd_config['enable']) {
+ restart_service("bandwidthd");
+ } else {
+ stop_service("bandwidthd");
+ }
+}
+
+function bandwidthd_upgrade_config() {
+ global $config, $changes;
+ // The 'Advanced Filter' options and 'Database Password' are now base64-encoded
+ // in order to now break config.xml if they contain some special chars.
+ // If this is an old config, pick up the original unencoded values and upgrade
+ $changes = 0;
+ $bandwidthd_config = $config['installedpackages']['bandwidthd']['config'][0];
+ if (isset($bandwidthd_config['filter'])) {
+ $config['installedpackages']['bandwidthd']['config'][0]['advfilter'] = base64_encode($bandwidthd_config['filter']);
+ unset($config['installedpackages']['bandwidthd']['config'][0]['filter']);
+ $changes++;
+ }
+ if (isset($bandwidthd_config['postgresqlpassword'])) {
+ $config['installedpackages']['bandwidthd']['config'][0]['postgresqlpasswordenc'] = base64_encode($bandwidthd_config['postgresqlpassword']);
+ unset($config['installedpackages']['bandwidthd']['config'][0]['postgresqlpassword']);
+ $changes++;
+ }
+ // Subnet(s) for Statistics Collection - convert old subnets_custom to interface_array here as well.
+ if (isset($bandwidthd_config['subnets_custom'])) {
+ $i = 0;
+ $subnets_custom = explode(';', $bandwidthd_config['subnets_custom']);
+ // For each configured interface on this box...
+ $iflist = get_configured_interface_list_by_realif();
+ foreach ($iflist as $if) {
+ // first, gets its subnet...
+ $sn = gen_subnet(get_interface_ip($if), get_interface_subnet($if));
+ foreach ($subnets_custom as $subnet_custom) {
+ // next, strip the subnet mask from the old settings value...
+ $subnet_custom = substr($subnet_custom, 0, strpos($subnet_custom, '/'));
+ // next, try to match the originally configured subnet against configured interfaces...
+ if ($subnet_custom != "" && $subnet_custom == $sn) {
+ // skip PPPoE interfaces if any...
+ $realif = get_real_interface($if);
+ if (!preg_match("/pppoe[0-9]+/i", $realif)) {
+ // and finally, set the new config value for config.xml
+ $config['installedpackages']['bandwidthd']['config'][0]['interface_array'][$i] = $if;
+ $i++;
+ $changes++;
+ }
+ }
+ }
+ }
+ // Remove the old settings value now that we are done with config upgrade
+ unset($config['installedpackages']['bandwidthd']['config'][0]['subnets_custom']);
+ }
+ // Write the upgraded config.xml if something changed
+ if ($changes > 0 ) {
+ write_config("[bandwidthd] Upgraded old package configuration.");
+ }
+}
+
+function bandwidthd_validate_input($post, &$input_errors) {
+ if ($post['active_interface']) {
+ $realif = get_real_interface($post['active_interface']);
+ $ip = find_interface_ip($realif);
+ if (!is_ipaddrv4($ip)) {
+ // IPv6-only interfaces are not supported
+ $errif = convert_friendly_interface_to_friendly_descr($post['active_interface']);
+ $input_errors[] = gettext("The \"{$errif}\" interface selected under 'BandwidthD Web Interface' has no IPv4 configured. Configured IPv4 is required.");
+ }
+ } else {
+ $input_errors[] = "You must select the 'BandwidthD Web Interface'.";
+ }
+ // bandwidthd does not work with PPPoE; IPv6 is also not supported
+ if ($post['interface_array']) {
+ foreach ($post['interface_array'] as $ifname) {
+ $realif = get_real_interface($ifname);
+ $ip = find_interface_ip($realif);
+ $errif = convert_friendly_interface_to_friendly_descr($ifname);
+ if (preg_match("/pppoe[0-9]+/i", $realif)) {
+ $input_errors[] = gettext("Sorry, BandwidthD does not support PPPoE interfaces. Remove \"{$errif}\" from 'Subnet(s) for Statistics Collection'.");
+ }
+ if (!is_ipaddrv4($ip)) {
+ $input_errors[] = gettext("The \"{$errif}\" interface selected under 'Subnet(s) for Statistics Collection' has no IPv4 configured. Configured IPv4 is required.");
+ }
+ }
+ } else {
+ $input_errors[] = "You must select at least on interface under 'Subnet(s) for Statistics Collection'.";
+ }
+ // Only support sane characters in Sensor ID
+ if ($post['sensorid']) {
+ if ((!is_hostname($post['sensorid'])) && !preg_match("/^[a-zA-Z0-9\-\=\(\):. ]*$/", $post['sensorid'])) {
+ $input_errors[] .= gettext('Sensor ID must be either a hostname or a string which may only contain characters matching ^[a-zA-Z0-9\-\(\):. ]*$ regexp.');
+ }
+ }
+ if (($post['meta_refresh']) && (!is_numericint($post['meta_refresh']))) {
+ $input_errors[] = gettext("The value for 'Meta Refresh' must be a positive integer.");
+ }
+ if (($post['skipintervals']) && (!is_numericint($post['skipintervals']))) {
+ $input_errors[] = gettext("The value for 'Skip Intervals' must be a positive integer.");
+ }
+ if (($post['graphcutoff']) && (!is_numericint($post['graphcutoff']))) {
+ $input_errors[] = gettext("The value for 'Graph Cutoff' must be a positive integer.");
+ }
+ if ($post['outputpostgresql']) {
+ if (!$post['postgresqlhost']) {
+ $input_errors[] = gettext("The value for 'Database Host' must not be empty when 'Output to PostgreSQL' is enabled.");
+ }
+ if (!$post['postgresqldatabase']) {
+ $input_errors[] = gettext("The value for 'Database Name' must not be empty when 'Output to PostgreSQL' is enabled.");
+ }
+ if (!$post['postgresqlusername']) {
+ $input_errors[] = gettext("The value for 'Database User' must not be empty when 'Output to PostgreSQL' is enabled.");
+ }
+ if (!$post['postgresqlpasswordenc']) {
+ $input_errors[] = gettext("The value for 'Database Password' must not be empty when 'Output to PostgreSQL' is enabled.");
+ }
+ }
+ if (($post['postgresqlhost']) && (!is_hostname($post['postgresqlhost']))) {
+ $input_errors[] = gettext("The value for 'Database Host' must be a valid hostname or IPv4.");
+ }
+ if (($post['advfilter']) && !preg_match("/^[a-zA-Z0-9\+\-\=\(\):. ]*$/", $post['advfilter'])) {
+ $input_errors[] = gettext('Advanced traffic filtering options may only contain characters matching ^[a-zA-Z0-9\+\-\=\(\):. ]*$ regexp.');
}
}
diff --git a/config/bandwidthd/bandwidthd.xml b/config/bandwidthd/bandwidthd.xml
index fc768761..1668f748 100644
--- a/config/bandwidthd/bandwidthd.xml
+++ b/config/bandwidthd/bandwidthd.xml
@@ -3,213 +3,297 @@
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
- <![CDATA[
+<![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- bandwidthd.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
+ bandwidthd.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2006 Scott Ullrich
+ Copyright (C) 2009 Bill Marquette
+ Copyright (C) 2012-2013 Phil Davis
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
]]>
</copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
<name>bandwidthd</name>
- <version>2.0.1_5 pkg v.0.4</version>
- <title>Bandwidthd</title>
+ <version>0.6</version>
+ <title>Diagnostics: Bandwidthd</title>
<aftersaveredirect>/pkg_edit.php?xml=bandwidthd.xml&amp;id=0</aftersaveredirect>
<include_file>/usr/local/pkg/bandwidthd.inc</include_file>
<menu>
<name>BandwidthD</name>
<tooltiptext></tooltiptext>
- <section>Services</section>
+ <section>Diagnostics</section>
+ <url>/bandwidthd/index.html</url>
+ </menu>
+ <menu>
+ <name>BandwidthD Settings</name>
+ <tooltiptext></tooltiptext>
+ <section>Diagnostics</section>
<url>/pkg_edit.php?xml=bandwidthd.xml&amp;id=0</url>
</menu>
<service>
- <name>bandwidthd</name>
- <rcfile>bandwidthd.sh</rcfile>
- <executable>bandwidthd</executable>
- <description>BandwidthD bandwidth monitoring daemon</description>
+ <name>bandwidthd</name>
+ <rcfile>bandwidthd.sh</rcfile>
+ <executable>bandwidthd</executable>
+ <description>BandwidthD bandwidth monitoring daemon</description>
</service>
<tabs>
<tab>
- <text>BandwidthD</text>
+ <text>Settings</text>
<url>/pkg_edit.php?xml=bandwidthd.xml&amp;id=0</url>
<active/>
</tab>
<tab>
<text>Access BandwidthD</text>
- <url>/bandwidthd/index.html" target="_blank</url>
+ <url>/bandwidthd/index.html</url>
</tab>
</tabs>
+ <advanced_options>enabled</advanced_options>
<configpath>installedpackages->package->bandwidthd</configpath>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>0677</chmod>
<item>https://packages.pfsense.org/packages/config/bandwidthd/bandwidthd.inc</item>
</additional_files_needed>
<fields>
<field>
- <fielddescr>Enable bandwidthd</fielddescr>
+ <name>General Options</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Enable BandwidthD</fielddescr>
<fieldname>enable</fieldname>
<type>checkbox</type>
<description></description>
</field>
<field>
- <fielddescr>Interface</fielddescr>
+ <fielddescr>BandwidthD Web Interface</fielddescr>
<fieldname>active_interface</fieldname>
- <description>The interface that bandwidthd will bind to.</description>
+ <description>Bind the BandwidthD web interface to IP address of the specified interface.</description>
<type>interfaces_selection</type>
+ <hideinterfaceregex>(loopback|wan)</hideinterfaceregex>
<required/>
<default_value>lan</default_value>
</field>
<field>
- <fielddescr>Subnet</fielddescr>
- <fieldname>subnets_custom</fieldname>
- <description>The subnet(s) on which bandwidthd will report. (separate with ';' for multiple subnets, e.g. 192.168.1.0/24;10.0.0.0/24) The ordinary subnet for the selected interface/s is automatically put in the config, do not specify it here.</description>
+ <fielddescr>Subnet(s) for Statistics Collection</fielddescr>
+ <fieldname>interface_array</fieldname>
+ <description>
+ <![CDATA[
+ The subnet(s) on which BandwidthD will collect statistics. Traffic that matches none of these subnets will be ignored.<br />
+ <strong>Note: PPPoE interfaces are NOT supported!</strong>
+ ]]>
+ </description>
+ <type>interfaces_selection</type>
+ <hideinterfaceregex>loopback</hideinterfaceregex>
+ <size>3</size>
+ <multiple>true</multiple>
+ <required/>
+ </field>
+ <field>
+ <fielddescr>Promiscuous</fielddescr>
+ <fieldname>promiscuous</fieldname>
+ <description>
+ <![CDATA[
+ Put interface in promiscuous mode to see traffic that may not be routing through the host machine.<br />
+ Note: If the interface is connected to a switch then the interface will only see the traffic on its port.
+ ]]>
+ </description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Sensor ID</fielddescr>
+ <fieldname>sensorid</fieldname>
+ <description>
+ <![CDATA[
+ Arbitrary sensor name.<br />
+ (Using the sensor's fully qualified domain name is recommended.)
+ ]]>
+ </description>
<type>input</type>
</field>
<field>
- <fielddescr>Skip intervals</fielddescr>
- <fieldname>skipintervals</fieldname>
- <description>Number of intervals to skip between graphing. Default 0. Each interval is 200 seconds = 3 min 20 sec.</description>
+ <name>Graph Options</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Draw Graphs</fielddescr>
+ <fieldname>drawgraphs</fieldname>
+ <description>
+ <![CDATA[
+ Enabled by default in order to graph the traffic that BandwidthD is recording. Uncheck this if you only want CDF output or you are using the database output option.<br />
+ BandwidthD will use very little RAM and CPU if this option is disabled.
+ ]]>
+ </description>
+ <type>checkbox</type>
+ <default_value>on</default_value>
+ </field>
+ <field>
+ <fielddescr>Meta Refresh</fielddescr>
+ <fieldname>meta_refresh</fieldname>
+ <description>
+ <![CDATA[
+ Sets the interval (seconds) at which the browser graph display refreshes<br />
+ Default 150, use 0 to disable.
+ ]]>
+ </description>
<type>input</type>
</field>
<field>
- <fielddescr>Graph cutoff</fielddescr>
- <fieldname>graphcutoff</fieldname>
- <description>Graph cutoff is how many KB must be transferred by an IP before it is graphed. Default 1024.</description>
+ <fielddescr>Skip Intervals</fielddescr>
+ <fieldname>skipintervals</fieldname>
+ <description>
+ <![CDATA[
+ Number of intervals to skip between graphing.<br />
+ Default 0. (Each interval is 200 seconds = 3 min 20 sec.)
+ ]]>
+ </description>
<type>input</type>
</field>
<field>
- <fielddescr>Promiscuous</fielddescr>
- <fieldname>promiscuous</fieldname>
- <description>Put interface in promiscuous mode to see traffic that may not be routing through the host machine.&lt;br&gt;
- Note: If the interface is connected to a switch then the interface will only see the traffic on its port.</description>
- <type>checkbox</type>
+ <fielddescr>Graph Cutoff</fielddescr>
+ <fieldname>graphcutoff</fieldname>
+ <description>
+ <![CDATA[
+ Graph cutoff means how many KB must be transferred by an IP before it is graphed.<br />
+ Default 1024.
+ ]]>
+ </description>
+ <type>input</type>
</field>
<field>
- <fielddescr>output_cdf</fielddescr>
+ <fielddescr>Output to CDF</fielddescr>
<fieldname>outputcdf</fieldname>
- <description>Log data to cdf files log*.cdf</description>
+ <description>Log data to CDF files log*.cdf</description>
<type>checkbox</type>
</field>
<field>
- <fielddescr>recover_cdf</fielddescr>
+ <fielddescr>Recover CDF</fielddescr>
<fieldname>recovercdf</fieldname>
- <description>Read back the cdf files on startup</description>
+ <description>Read back the CDF files on startup.</description>
<type>checkbox</type>
</field>
<field>
- <fielddescr>output PostgreSQL</fielddescr>
+ <fielddescr>Graph and Log Info</fielddescr>
+ <fieldname>graph_log_info</fieldname>
+ <description>
+ <![CDATA[
+ If "Draw Graphs" is on, then the daily report and graph html data is regenerated every (skip intervals + 1) * 200 seconds.&nbsp;
+ The data volumes in the report are for the same period as the span of the graph.<br />
+ If "Output to CDF" is on, then a cron job is added to rotate the log files at 00:01 each day. 6 log files are kept for each log frequency (daily, weekly, monthly, yearly).&nbsp;
+ At the respective rotation intervals, the oldest log is deleted, the others are shuffled back and a new log is created.<br /><br />
+ <table cellpadding="1" cellspacing="0" style="text-align: left"><tbody>
+ <tr><th></th><th>Data Interval</th><th>Graph Span</th><th>Log Rotation</th><th>Log File Name</th></tr>
+ <tr><th>Daily</th><td>200 seconds</td><td>2 days</td><td>1 day</td><td>log.1.[0-5].cdf</td></tr>
+ <tr><th>Weekly</th><td>10 minutes</td><td>7 days</td><td>7 days</td><td>log.2.[0-5].cdf</td></tr>
+ <tr><th>Monthly</th><td>1 hour</td><td>35 days</td><td>35 days</td><td>log.3.[0-5].cdf</td></tr>
+ <tr><th>Yearly</th><td>12 hours</td><td>412.5 days</td><td>412.5 days </td><td>log.4.[0-5].cdf</td></tr>
+ </tbody></table>
+ ]]>
+ </description>
+ <type>info</type>
+ </field>
+ <field>
+ <name>PostgreSQL Options</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Output to PostgreSQL</fielddescr>
<fieldname>outputpostgresql</fieldname>
- <description>Log data to a PostgreSQL database.&lt;br&gt;
- Get the postgreSQL schema and PHP files to display the results from: &lt;a target="_new" href="https://github.com/individual-it/bandwidthd-pSQL-frontend"&gt;https://github.com/individual-it/bandwidthd-pSQL-frontend&lt;/a&gt;</description>
+ <description>
+ <![CDATA[
+ Log data to a PostgreSQL database.<br />
+ Get the PostgreSQL schema and PHP files to display the results from <a href="https://github.com/individual-it/bandwidthd-pSQL-frontend">https://github.com/individual-it/bandwidthd-pSQL-frontend</a>
+ ]]>
+ </description>
+ <enablefields>postgresqlhost,postgresqldatabase,postgresqlusername,postgresqlpasswordenc</enablefields>
<type>checkbox</type>
</field>
<field>
- <fielddescr>Database host</fielddescr>
+ <fielddescr>Database Host</fielddescr>
<fieldname>postgresqlhost</fieldname>
- <description>Hostname of the postgreSQL database server.</description>
+ <description>Hostname of the PostgreSQL database server.</description>
<type>input</type>
</field>
<field>
- <fielddescr>Database name</fielddescr>
+ <fielddescr>Database Name</fielddescr>
<fieldname>postgresqldatabase</fieldname>
- <description>Database on the postgreSQL database server.</description>
+ <description>Database on the PostgreSQL database server.</description>
<type>input</type>
</field>
<field>
<fielddescr>Database Username</fielddescr>
<fieldname>postgresqlusername</fieldname>
- <description>Username of the postgreSQL database server.</description>
+ <description>Username of the PostgreSQL database server.</description>
<type>input</type>
</field>
<field>
<fielddescr>Database Password</fielddescr>
- <fieldname>postgresqlpassword</fieldname>
- <description>Password of the postgreSQL database server.</description>
+ <fieldname>postgresqlpasswordenc</fieldname>
+ <description>Password of the PostgreSQL database server.</description>
<type>password</type>
+ <encoding>base64</encoding>
</field>
<field>
- <fielddescr>sensor_id</fielddescr>
- <fieldname>sensorid</fieldname>
- <description>Arbitrary sensor name, I recommend the sensors fully qualified domain name.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Filter</fielddescr>
- <fieldname>filter</fieldname>
- <description>Libpcap format filter string used to control what bandwidthd sees. Please always include "ip" in the string to avoid strange problems.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Draw Graphs</fielddescr>
- <fieldname>drawgraphs</fieldname>
- <description>This defaults to true to graph the traffic bandwidthd is recording. Set this to false if you only want cdf output or you are using the database output option. Bandwidthd will use very little RAM and CPU if this is set to false.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Meta Refresh</fielddescr>
- <fieldname>meta_refresh</fieldname>
- <description>Sets the interval (seconds) at which the browser graph display refreshes (default 150, use 0 to disable).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Graph and Log Info</fielddescr>
- <fieldname>graph_log_info</fieldname>
- <description>If draw graphs is on, then the daily report and graph html data is regenerated every (skip intervals + 1) * 200 seconds. The data volumes in the report are for the same period as the span of the graph.&lt;br&gt;
- If output_cdf is on, then a cron job is added to rotate the log files at 00:01 each day. 6 log files are kept for each log frequency (daily, weekly, monthly, yearly). At the respective rotation intervals, the oldest log is deleted, the others are shuffled back and a new log is created.&lt;br&gt;
- &lt;table cellpadding=1 cellspacing=0 style=&quot;text-align: left;&quot;&gt; &lt;tbody&gt;
- &lt;tr&gt;&lt;th&gt; &lt;/th&gt;&lt;th&gt; Data Interval &lt;/th&gt;&lt;th&gt; Graph Span &lt;/th&gt;&lt;th&gt; Log Rotation &lt;/th&gt;&lt;th&gt; Log File Name &lt;/th&gt;&lt;/tr&gt;
- &lt;tr&gt;&lt;th&gt; Daily &lt;/th&gt;&lt;td&gt; 200 seconds &lt;/td&gt;&lt;td&gt; 2 days &lt;/td&gt;&lt;td&gt; 1 day &lt;/td&gt;&lt;td&gt; log.1.[0-5].cdf &lt;/td&gt;&lt;/tr&gt;
- &lt;tr&gt;&lt;th&gt; Weekly &lt;/th&gt;&lt;td&gt; 10 minutes &lt;/td&gt;&lt;td&gt; 7 days &lt;/td&gt;&lt;td&gt; 7 days &lt;/td&gt;&lt;td&gt; log.2.[0-5].cdf &lt;/td&gt;&lt;/tr&gt;
- &lt;tr&gt;&lt;th&gt; Monthly &lt;/th&gt;&lt;td&gt; 1 hour &lt;/td&gt;&lt;td&gt; 35 days &lt;/td&gt;&lt;td&gt; 35 days &lt;/td&gt;&lt;td&gt; log.3.[0-5].cdf &lt;/td&gt;&lt;/tr&gt;
- &lt;tr&gt;&lt;th&gt; Yearly &lt;/th&gt;&lt;td&gt; 12 hours &lt;/td&gt;&lt;td&gt; 412.5 days &lt;/td&gt;&lt;td&gt; 412.5 days &lt;/td&gt;&lt;td&gt; log.4.[0-5].cdf &lt;/td&gt;&lt;/tr&gt;
- &lt;/tbody&gt; &lt;/table&gt;
+ <fielddescr>Advanced Filter</fielddescr>
+ <fieldname>advfilter</fieldname>
+ <description>
+ <![CDATA[
+ Libpcap format filter string used to control what traffic is counted.&nbsp;
+ Please, refer to <a href="https://www.freebsd.org/cgi/man.cgi?query=pcap-filter&amp;sektion=7&amp;apropos=0&amp;manpath=FreeBSD+10.1-RELEASE+and+Ports">pcap-filter(7)</a> for documentation.
+ <br />
+ NOTE: You should always specify "ip" in the filter to avoid strange results.<br /><br />
+ Example: We only want to account for a certain IP.<br />
+ Filter expression: <em>ip and host 192.0.2.1</em><br /><br />
+ <strong>WARNING: You are completely on your own with this! If misconfigured, BandwidthD will malfunction or even not start at all.</strong>
+ ]]>
</description>
- <type>info</type>
+ <type>textarea</type>
+ <encoding>base64</encoding>
+ <cols>65</cols>
+ <rows>1</rows>
+ <advancedfield/>
</field>
</fields>
<custom_php_resync_config_command>
bandwidthd_install_config();
</custom_php_resync_config_command>
<custom_php_install_command>
+ bandwidthd_upgrade_config();
bandwidthd_install_config();
</custom_php_install_command>
<custom_php_deinstall_command>
bandwidthd_install_deinstall();
</custom_php_deinstall_command>
+ <custom_php_validation_command>
+ bandwidthd_validate_input($_POST, $input_errors);
+ </custom_php_validation_command>
</packagegui>
diff --git a/config/open-vm-tools_2/open-vm-tools.inc b/config/open-vm-tools_2/open-vm-tools.inc
index 912c4032..f005074e 100644
--- a/config/open-vm-tools_2/open-vm-tools.inc
+++ b/config/open-vm-tools_2/open-vm-tools.inc
@@ -1,22 +1,56 @@
<?php
-
+/*
+ open-vm-tools.inc
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008-2015 Electric Sheep Fencing LP
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
function open_vm_tools_deinstall() {
- exec("rm /usr/local/etc/rc.d/vmware*");
+ conf_mount_rw();
+ stop_service("vmware-guestd");
+ unlink_if_exists("/usr/local/etc/rc.d/vmware-guestd.sh");
+ unlink_if_exists("/usr/local/etc/rc.d/vmware-kmod.sh");
unlink_if_exists("/boot/kernel/vmblock.ko");
unlink_if_exists("/boot/kernel/vmhgfs.ko");
unlink_if_exists("/boot/kernel/vmmemctl.ko");
unlink_if_exists("/boot/kernel/vmxnet.ko");
+ conf_mount_ro();
}
function open_vm_tools_install() {
+ conf_mount_rw();
- // clean up old .ko files if they exist
+ // Clean up old .ko files if they exist
unlink_if_exists("/boot/kernel/vmblock.ko");
unlink_if_exists("/boot/kernel/vmhgfs.ko");
unlink_if_exists("/boot/kernel/vmmemctl.ko");
unlink_if_exists("/boot/kernel/vmxnet.ko");
+ // Remove other unused files if they exist
+ unlink_if_exists("/usr/local/etc/rc.d/vmware-kmod");
+ unlink_if_exists("/usr/local/etc/rc.d/vmware-guestd");
- $pfs_version=substr(trim(file_get_contents("/etc/version")),0,3);
+ $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
if ($pfs_version == "2.1") {
$openvmtools_path = "/usr/pbi/open-vm-tools-nox11-" . php_uname("m");
} else if ($pfs_version == "2.2") {
@@ -24,10 +58,7 @@ function open_vm_tools_install() {
} else {
$openvmtools_path = "/usr/local";
}
-
- // won't copy this either for now, some sequences of loading/unloading of the module will kernel panic.
- //exec("cp $openvmtools_path/local/lib/vmware-tools/modules/drivers/vmmemctl.ko /boot/kernel/");
-
+
$vmware_tools_conf = <<<EOF
[powerops]
poweron-script=
@@ -40,10 +71,10 @@ EOF;
$vmware_guestd = <<<EOF
#!/bin/sh
#
-# This file was automatically generated
+# This file was automatically generated
# by the pfSense package manager.
-#
-# Do not edit this file. Edit
+#
+# Do not edit this file. Edit
# /usr/local/pkg/open-vm-tools.inc instead.
#
# PROVIDE: vmware-guestd
@@ -76,10 +107,10 @@ EOF;
$vmware_kmod = <<<EOF
#!/bin/sh
#
-# This file was automatically generated
+# This file was automatically generated
# by the pfSense package manager.
-#
-# Do not edit this file. Edit
+#
+# Do not edit this file. Edit
# /usr/local/pkg/open-vm-tools.inc instead.
#
# PROVIDE: vmware-kmod
@@ -120,8 +151,9 @@ EOF;
}
fwrite($fd, $vmware_guestd);
fclose($fd);
+ chmod("/usr/local/etc/rc.d/vmware-guestd.sh", 0755);
- /* the kernel modules aren't stable at this time, omit them.
+ /* The kernel modules aren't stable at this time, omit them.
$fd = fopen("/usr/local/etc/rc.d/vmware-kmod.sh", "w");
if (!$fd) {
log_error("Could not open /usr/local/etc/rc.d/vmware-kmod.sh for writing");
@@ -129,8 +161,12 @@ EOF;
}
fwrite($fd, $vmware_kmod);
fclose($fd);
+ chmod("/usr/local/etc/rc.d/vmware-kmod.sh", 0755);
*/
-
+ /* Won't copy this either for now, some sequences of loading/unloading of the module will cause kernel panic.
+ mwexec("/bin/cp $openvmtools_path/local/lib/vmware-tools/modules/drivers/vmmemctl.ko /boot/kernel/");
+ */
+
$fd = fopen("$openvmtools_path/share/vmware-tools/tools.conf", "w");
if (!$fd) {
log_error("Could not open $openvmtools_path/share/vmware-tools/tools.conf for writing");
@@ -139,13 +175,7 @@ EOF;
fwrite($fd, $vmware_tools_conf);
fclose($fd);
- // Remove non used files
- unlink_if_exists("/usr/local/etc/rc.d/vmware-kmod");
- unlink_if_exists("/usr/local/etc/rc.d/vmware-guestd");
-
- // Make sure files are executable.
- exec("chmod a+rx /usr/local/etc/rc.d/*.sh");
-
+ start_service("vmware-guestd");
}
?>
diff --git a/config/open-vm-tools_2/open-vm-tools.xml b/config/open-vm-tools_2/open-vm-tools.xml
index 5540672b..b2bd6d7f 100644
--- a/config/open-vm-tools_2/open-vm-tools.xml
+++ b/config/open-vm-tools_2/open-vm-tools.xml
@@ -1,63 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <copyright>
- <![CDATA[
- /* ========================================================================== */
- /*
- open-vm-tools.xml
- part of pfSense (http://www.pfSense.org)
- Copyright (C) 2008-2015 Electric Sheep Fencing LP
- All rights reserved.
+ <copyright>
+<![CDATA[
+/* $Id$ */
+/* ====================================================================================== */
+/*
+ open-vm-tools.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008-2015 Electric Sheep Fencing LP
+ All rights reserved.
+*/
+/* ====================================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
- /* ========================================================================== */
- /*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
<name>open-vm-tools</name>
- <version>313025</version>
+ <version>1280544.11</version>
<title>Open VM Tools</title>
+ <include_file>/usr/local/pkg/open-vm-tools.inc</include_file>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
<item>https://packages.pfsense.org/packages/config/open-vm-tools_2/open-vm-tools.inc</item>
- </additional_files_needed>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_install_command>
- conf_mount_rw();
+ </additional_files_needed>
+ <service>
+ <name>vmware-guestd</name>
+ <rcfile>vmware-guestd.sh</rcfile>
+ <executable>vmtoolsd</executable>
+ <description>VMware Guest Daemon</description>
+ </service>
+ <custom_php_install_command>
open_vm_tools_install();
- exec("/usr/local/etc/rc.d/vmware-guestd.sh start");
- conf_mount_ro();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- conf_mount_rw();
- exec("/usr/local/etc/rc.d/vmware-guestd.sh stop");
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
open_vm_tools_deinstall();
- conf_mount_ro();
- </custom_php_deinstall_command>
- <include_file>/usr/local/pkg/open-vm-tools.inc</include_file>
+ </custom_php_deinstall_command>
</packagegui>
diff --git a/config/phpservice/phpservice.inc b/config/phpservice/phpservice.inc
index ec2b9bef..cffdb09f 100644
--- a/config/phpservice/phpservice.inc
+++ b/config/phpservice/phpservice.inc
@@ -1,14 +1,11 @@
<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- phpservice.inc
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
/*
+ phpservice.inc
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -30,194 +27,100 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+function phpservice_sync_package() {
+ global $config;
+
+ if ($config['installedpackages']['phpservice']['config'] != "") {
+
+ conf_mount_rw();
+ $tmp = <<<EOF
+<?php
+
+// Set time limit to indefinite execution
+set_time_limit (0);
-if (!function_exists("pkg_is_service_running")) {
- function pkg_is_service_running($servicename)
- {
- exec("/bin/ps ax | awk '{ print $5 }'", $psout);
- array_shift($psout);
- foreach($psout as $line) {
- $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
- }
- if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
- return true;
- }
- else {
- return false;
- }
+//run this program as long as the pid file exists
+$filename = '/tmp/phpmonitor.pid';
+$fp = fopen($filename, 'w');
+fwrite($fp, "If this file is deleted then phpmonitor will stop.");
+fclose($fp);
+unset($filename);
+
+function send_to_syslog($syslogaddress, $syslogport, $syslogmsg) {
+
+ $syslogaddress = "127.0.0.1";
+ $syslogport = 514;
+
+ $fp = fsockopen("udp://".$syslogaddress, $syslogport, $errno, $errstr);
+ if (!$fp) {
+ return;
+ } else {
+ fwrite($fp, $syslogmsg);
+ fclose($fp);
}
}
-if (!function_exists("byte_convert")) {
- function byte_convert( $bytes ) {
- if ($bytes<=0)
- return '0 Byte';
+$x = 0;
+while ($x == 0) {
- $convention=1000; //[1000->10^x|1024->2^x]
- $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
- $e=floor(log($bytes,$convention));
- return round($bytes/pow($convention,$e),2).' '.$s[$e];
- }
+// If the pid file does not exist then close the program.
+if (!file_exists('/tmp/phpmonitor.pid')) {
+ return;
}
-
-function phpservice_sync_package_php()
-{
-
- global $config;
- if($config['installedpackages']['phpservice']['config'] != "") {
-
- conf_mount_rw();
-
- $tmp = "<?php\n";
- $tmp .= "\n";
- $tmp .= "// Set time limit to indefinite execution\n";
- $tmp .= "set_time_limit (0);\n";
- $tmp .= "\n";
- $tmp .= "//run this program as long as the pid file exists\n";
- $tmp .= "\$filename = '/tmp/phpmonitor.pid';\n";
- $tmp .= "\$fp = fopen(\$filename, 'w');\n";
- $tmp .= "fwrite(\$fp, \"If this file is deleted then phpmonitor will stop.\");\n";
- $tmp .= "fclose(\$fp);\n";
- $tmp .= "unset(\$filename);\n";
- $tmp .= "\n";
- $tmp .= "//require_once(\"config.inc\");\n";
- $tmp .= "//global \$config;\n";
- $tmp .= "//\$syslogaddress = \$config['syslog']['remoteserver'];\n";
- $tmp .= "\$syslogaddress = \"127.0.0.1\";\n";
- $tmp .= "\$syslogport = 514;\n";
- $tmp .= "echo \"syslog server: \".\$syslogaddress.\"\\n\";\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= "function send_to_syslog(\$syslogaddress, \$syslogport, \$syslogmsg) {\n";
- $tmp .= "\n";
- $tmp .= " \$fp = fsockopen(\"udp://\".\$syslogaddress, \$syslogport, \$errno, \$errstr);\n";
- $tmp .= " if (!\$fp) {\n";
- $tmp .= " //echo \"ERROR: \$errno - \$errstr<br />\\n\";\n";
- $tmp .= " } else {\n";
- $tmp .= " fwrite(\$fp, \$syslogmsg);\n";
- $tmp .= " fclose(\$fp);\n";
- $tmp .= " }\n";
- $tmp .= "\n";
- $tmp .= "}\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= "//\$msg = \"1.begin loop. \".date('r').\"\\n\";\n";
- $tmp .= "//\$fp = fopen('/tmp/phpmonitor.txt', 'a');\n";
- $tmp .= "//fwrite(\$fp, \$msg.\"\\n\");\n";
- $tmp .= "//fclose(\$fp);\n";
- $tmp .= "\n";
- $tmp .= "\$x = 0;\n";
- $tmp .= "while(\$x == 0) {\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= " if(!file_exists('/tmp/phpmonitor.pid')) {\n";
- $tmp .= " //if the file does not exist then close the program.\n";
- $tmp .= " echo \"program closing\\n\";\n";
- $tmp .= " return;\n";
- $tmp .= " }\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= "\n";
-
- foreach($config['installedpackages']['phpservice']['config'] as $rowhelper) {
+
+EOF;
+
+ foreach ($config['installedpackages']['phpservice']['config'] as $rowhelper) {
if ($rowhelper['enabled'] != "false") {
$tmp_php = base64_decode($rowhelper['php']);
if (strlen($tmp_php) > 0) {
$tmp .= "// name: ".$rowhelper['name']." \n";
- $tmp .= "// description: ".$rowhelper['description']." \n\n";
+ $tmp .= "// description: ".$rowhelper['description']." \n\n";
$tmp .= base64_decode($rowhelper['php']);
$tmp .= "\n";
}
}
-
}
-
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= " //usleep(100000); //micro seconds //2 seconds 2000000\n";
- $tmp .= " sleep(1); //in seconds\n";
- $tmp .= " //if (\$x > 60){ exit; } //exit after 60 seconds for testing\n";
- $tmp .= "} //emd while\n";
- $tmp .= "\n";
- $tmp .= "\n";
- $tmp .= "?>";
-
- $fout = fopen("/usr/local/pkg/phpservice.php","w");
- fwrite($fout, $tmp);
- unset($tmp);
- fclose($fout);
-
- conf_mount_ro();
-
- }
-}
+ $tmp .= <<< EOF
-function phpservice_sync_package()
-{
-
- global $config;
- phpservice_sync_package_php();
+sleep(1);
}
-
+?>
-function phpservice_install_command()
-{
+EOF;
- global $config;
- conf_mount_rw();
+ $fout = fopen("/usr/local/pkg/phpservice.php", "w");
+ fwrite($fout, $tmp);
+ unset($tmp);
+ fclose($fout);
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/phpservice/')) {
- exec("mkdir /usr/local/www/packages/phpservice/");
+ restart_service("phpservice");
+ conf_mount_ro();
+ } else {
+ stop_service("phpservice");
}
+}
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/phpservice_php.tmp /usr/local/www/packages/phpservice/phpservice_php.php");
- unlink_if_exists("/tmp/phpservice_php.tmp");
-
- exec("cp /tmp/phpservice_php_edit.tmp /usr/local/www/packages/phpservice/phpservice_php_edit.php");
- unlink_if_exists("/tmp/phpservice_php_edit.tmp");
-
- //write_config();
-
+function phpservice_install_command() {
+ conf_mount_rw();
write_rcfile(array(
"file" => "phpservice.sh",
"start" => "/usr/local/bin/php /usr/local/pkg/phpservice.php >> /var/log/phpservice.log &",
- "stop" => "rm /tmp/phpmonitor.pid"
+ "stop" => "/bin/rm -f /tmp/phpmonitor.pid; sleep 3"
)
);
-
phpservice_sync_package();
- //$handle = popen("/usr/local/etc/rc.d/phpservice.sh start", "r");
- //pclose($handle);
-
- //if (pkg_is_service_running('phpservice')) {
- //documentation purposes
- //}
-
conf_mount_ro();
-
}
-function phpservice_deinstall_command()
-{
-
+function phpservice_deinstall_command() {
conf_mount_rw();
- $handle = popen("/usr/local/etc/rc.d/phpservice.sh stop", "r");
- unlink_if_exists("/usr/local/pkg/phpservice.xml");
- unlink_if_exists("/usr/local/pkg/phpservice.inc");
- unlink_if_exists("/usr/local/www/phpservice.inc");
+ stop_service("phpservice");
unlink_if_exists("/usr/local/etc/rc.d/phpservice.sh");
conf_mount_ro();
-
}
?>
diff --git a/config/phpservice/phpservice.xml b/config/phpservice/phpservice.xml
index eb7e670e..e437be20 100644
--- a/config/phpservice/phpservice.xml
+++ b/config/phpservice/phpservice.xml
@@ -1,47 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
- <copyright>
- <![CDATA[
+ <copyright>
+<![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- phpservice.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
+ phpservice.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>PHP Service</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
+ </copyright>
+ <description>PHP Service</description>
<name>PHP Service Settings</name>
- <version>0.4.1</version>
+ <version>0.5.0</version>
<title>Settings</title>
<include_file>/usr/local/pkg/phpservice.inc</include_file>
<menu>
@@ -55,66 +57,27 @@
<name>phpservice</name>
<rcfile>phpservice.sh</rcfile>
<executable>phpservice</executable>
- <description>PHP run from a command line as a service.</description>
+ <description>PHP script as a service</description>
<custom_php_service_status_command>
- exec("/bin/pgrep -f phpservice");
+ exec("/bin/pgrep -fq phpservice");
</custom_php_service_status_command>
</service>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=phpservice.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Settings</text>
- <url>/packages/phpservice_php.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->phpservice</configpath>
+ <configpath>installedpackages->package->$packagename->configuration->phpservice</configpath>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/phpservice/phpservice.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
<item>https://packages.pfsense.org/packages/config/phpservice/phpservice.inc</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/phpservice/phpservice_php.tmp</item>
+ <prefix>/usr/local/www/packages/phpservice/</prefix>
+ <item>https://packages.pfsense.org/packages/config/phpservice/phpservice_php.php</item>
</additional_files_needed>
<additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/phpservice/phpservice_php_edit.tmp</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Variable One</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Variable Two</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
+ <prefix>/usr/local/www/packages/phpservice/</prefix>
+ <item>https://packages.pfsense.org/packages/config/phpservice/phpservice_php_edit.php</item>
+ </additional_files_needed>
<custom_php_resync_config_command>
phpservice_sync_package();
</custom_php_resync_config_command>
- <custom_delete_php_command>
- phpservice_sync_package();
- </custom_delete_php_command>
<custom_php_install_command>
phpservice_install_command();
</custom_php_install_command>
diff --git a/config/phpservice/phpservice_php.php b/config/phpservice/phpservice_php.php
new file mode 100644
index 00000000..582d2f41
--- /dev/null
+++ b/config/phpservice/phpservice_php.php
@@ -0,0 +1,151 @@
+<?php
+/*
+ phpservice_php.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+require("guiconfig.inc");
+require("/usr/local/pkg/phpservice.inc");
+
+$a_phpservice = &$config['installedpackages']['phpservice']['config'];
+
+if ($_GET['act'] == "del") {
+ if ($_GET['type'] == 'php') {
+ if ($a_phpservice[$_GET['id']]) {
+ unset($a_phpservice[$_GET['id']]);
+ write_config();
+ header("Location: phpservice_php.php");
+ exit;
+ }
+ }
+}
+
+$pgtitle = "PHP Service";
+include("head.inc");
+
+?>
+
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php");
+ display_top_tabs($tab_array);
+
+?>
+</td></tr>
+</table>
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabcont" >
+ <form action="phpservice_php.php" method="post" name="iform" id="iform">
+<?php
+if ($config_change == 1) {
+ write_config();
+ $config_change = 0;
+}
+?>
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr><td>
+ <div>
+ The custom PHP code that is defined below is run over and over again inside a continuous loop. There are many possible uses such as monitoring CPU, Memory, File System Space, interacting with Snort, and many others uses that are yet to be discovered.<br />
+ It can send events to the sylog that will can be viewed from the system log or remote syslog server. Example: <em>exec("logger This is a test");</em><br /><br />
+ For more information see: <a href='https://doc.pfsense.org/index.php/PHPService'>https://doc.pfsense.org/index.php/PHPService</a>
+ </div>
+ </td></tr>
+ </table>
+ <br />
+
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="30%" class="listhdrr">Name</td>
+ <td width="20%" class="listhdrr">Enabled</td>
+ <td width="40%" class="listhdr">Description</td>
+ <td width="10%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td width="17"></td>
+ <td valign="middle"><a href="phpservice_php_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <?php
+ $i = 0;
+ if (count($a_phpservice) > 0) {
+ foreach ($a_phpservice as $ent) {
+ ?>
+ <tr>
+ <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"><?=$ent['name'];?>&nbsp;</td>
+ <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"><?=$ent['enabled'];?>&nbsp;</td>
+ <td class="listbg" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';"><?=htmlspecialchars($ent['description']);?>&nbsp;</td>
+ <td valign="middle" nowrap class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle"><a href="phpservice_php_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="" /></a></td>
+ <td><a href="phpservice_php_edit.php?type=php&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php $i++;
+ }
+ }
+ ?>
+
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td width="17"></td>
+ <td valign="middle"><a href="phpservice_php_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list"></td>
+ </tr>
+ </table>
+ </form>
+<br />
+
+</td></tr>
+</table>
+</div>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/phpservice/phpservice_php.tmp b/config/phpservice/phpservice_php.tmp
deleted file mode 100644
index 55de1ae8..00000000
--- a/config/phpservice/phpservice_php.tmp
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/* $Id$ */
-/*
- phpservice_php.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-require("/usr/local/pkg/phpservice.inc");
-
-$a_phpservice = &$config['installedpackages']['phpservice']['config'];
-
-
-if ($_GET['act'] == "del") {
- if ($_GET['type'] == 'php') {
- if ($a_phpservice[$_GET['id']]) {
- unset($a_phpservice[$_GET['id']]);
- write_config();
- header("Location: phpservice_php.php");
- exit;
- }
- }
-}
-
-include("head.inc");
-
-?>
-
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">PHP Service:</p>
-
-<div id="mainlevel">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabnavtbl">
-<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php");
- display_top_tabs($tab_array);
-
-?>
-</td></tr>
-</table>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
-
-<form action="phpservice_php.php" method="post" name="iform" id="iform">
-<?php
-
-if ($config_change == 1) {
- write_config();
- $config_change = 0;
-}
-
-//if ($savemsg) print_info_box($savemsg);
-//if (file_exists($d_hostsdirty_path)): echo"<p>";
-//print_info_box_np("This is an info box.");
-//echo"<br />";
-//endif;
-
-?>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td><p><!--<span class="vexpl"><span class="red"><strong>PHP Service<br></strong></span>-->
- Is command line PHP designed to run PHP as a Service. The custom PHP code that is defined below is run over and over again inside a continuous loop. There are many possible uses such as monitoring CPU, Memory, File System Space, interacting with Snort, and many others uses that are yet to be discovered.
- It can send events to the sylog that will can be viewed from the system log or remote syslog server. example: exec("logger This is a test");
- <br /><br />
- For more information see: <a href='https://doc.pfsense.org/index.php/PHPService'>https://doc.pfsense.org/index.php/PHPService</a>
- </p></td>
- </tr>
- </table>
- <br />
-
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="30%" class="listhdrr">Name</td>
- <td width="20%" class="listhdrr">Enabled</td>
- <td width="40%" class="listhdr">Description</td>
- <td width="10%" class="list">
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td width="17"></td>
- <td valign="middle"><a href="phpservice_php_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
-
- </td>
- </tr>
-
-
- <?php
-
- $i = 0;
- if (count($a_phpservice) > 0) {
-
- foreach ($a_phpservice as $ent) {
-
- ?>
- <tr>
- <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';">
- <?=$ent['name'];?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';">
- <?=$ent['enabled'];?>&nbsp;
- </td>
- <td class="listbg" ondblclick="document.location='phpservice_php_edit.php?id=<?=$i;?>';">
- <font color="#FFFFFF"><?=htmlspecialchars($ent['description']);?>&nbsp;
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="phpservice_php_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td><a href="phpservice_php_edit.php?type=php&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php
-
- $i++;
- }
- }
- ?>
-
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td width="17"></td>
- <td valign="middle"><a href="phpservice_php_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
-
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list"></td>
- </tr>
- </table>
-
-</form>
-
-
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-
-</td>
-</tr>
-</table>
-
-</div>
-
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/phpservice/phpservice_php_edit.php b/config/phpservice/phpservice_php_edit.php
new file mode 100644
index 00000000..9727add6
--- /dev/null
+++ b/config/phpservice/phpservice_php_edit.php
@@ -0,0 +1,180 @@
+<?php
+/*
+ phpservice_php_edit.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+require("guiconfig.inc");
+require("/usr/local/pkg/phpservice.inc");
+
+$a_phpservice = &$config['installedpackages']['phpservice']['config'];
+
+$id = $_GET['id'];
+if (isset($_POST['id'])) {
+ $id = $_POST['id'];
+}
+
+if ($_GET['act'] == "del") {
+ if ($_GET['type'] == 'php') {
+ if ($a_phpservice[$_GET['id']]) {
+ unset($a_phpservice[$_GET['id']]);
+ write_config();
+ phpservice_sync_package();
+ header("Location: phpservice_php.php");
+ exit;
+ }
+ }
+}
+
+if (isset($id) && $a_phpservice[$id]) {
+ $pconfig['name'] = $a_phpservice[$id]['name'];
+ $pconfig['php'] = base64_decode($a_phpservice[$id]['php']);
+ $pconfig['enabled'] = $a_phpservice[$id]['enabled'];
+ $pconfig['description'] = $a_phpservice[$id]['description'];
+}
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+ if (!$input_errors) {
+
+ $ent = array();
+ $ent['name'] = $_POST['name'];
+ $ent['php'] = base64_encode($_POST['php']);
+ $ent['enabled'] = $_POST['enabled'];
+ $ent['description'] = $_POST['description'];
+
+ if (isset($id) && $a_phpservice[$id]) {
+ //update
+ $a_phpservice[$id] = $ent;
+ }
+ else {
+ //add
+ $a_phpservice[] = $ent;
+ }
+
+ write_config();
+ phpservice_sync_package();
+
+ header("Location: phpservice_php.php");
+ exit;
+ }
+}
+
+$pgtitle = "PHP Service: Edit";
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<script type="text/javascript">
+//<![CDATA[
+function show_advanced_config() {
+ document.getElementById("showadvancedbox").innerHTML='';
+ aodiv = document.getElementById('showadvanced');
+ aodiv.style.display = "block";
+//]]>
+</script>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php");
+ display_top_tabs($tab_array);
+?>
+</td></tr>
+</table>
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabcont"><br />
+ <form action="phpservice_php_edit.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="25%" valign="top" class="vncellreq">Name</td>
+ <td width="75%" class="vtable"><input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">PHP</td>
+ <td width="78%" class="vtable">
+ <?php
+ echo "<textarea name=\"php\" id=\"php\" cols=\"70\" rows=\"15\" wrap=\"off\">" . htmlspecialchars($pconfig['php']) . "</textarea>\n";
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Enabled</td>
+ <td width="78%" class="vtable">
+ <?php
+ echo "\t\t<select name='enabled' class='formfld'>\n";
+ echo "\t\t\t<option></option>\n";
+ switch (htmlspecialchars($pconfig['enabled'])) {
+ case "true":
+ echo "\t\t\t<option value='true' selected='selected'>true</option>\n";
+ echo "\t\t\t<option value='false'>false</option>\n";
+ break;
+ case "false":
+ echo "\t\t\t<option value='true'>true</option>\n";
+ echo "\t\t\t<option value='false' selected='selected'>false</option>\n";
+ break;
+ default:
+ echo "\t\t\t<option value='true' selected='selected'>true</option>\n";
+ echo "\t\t\t<option value='false'>false</option>\n";
+ }
+ echo "\t\t</select>\n";
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="25%" valign="top" class="vncellreq">Description</td>
+ <td width="75%" class="vtable">
+ <input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>" />
+ <br /><span class="vexpl">Enter the description here.<br /></span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">&nbsp;</td>
+ <td>
+ <input name="Submit" type="submit" class="formbtn" value="Save" />&nbsp;<input class="formbtn" type="button" value="Cancel" onclick="history.back()" />
+ <?php if (isset($id) && $a_phpservice[$id]): ?><input name="id" type="hidden" value="<?=$id;?>" /><?php endif; ?>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <br />
+
+</td></tr>
+</table>
+</div>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/phpservice/phpservice_php_edit.tmp b/config/phpservice/phpservice_php_edit.tmp
deleted file mode 100644
index 20a9998a..00000000
--- a/config/phpservice/phpservice_php_edit.tmp
+++ /dev/null
@@ -1,225 +0,0 @@
-<?php
-/* $Id$ */
-/*
-
- phpservice_php_edit.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-require("/usr/local/pkg/phpservice.inc");
-
-
-$a_phpservice = &$config['installedpackages']['phpservice']['config'];
-
-$id = $_GET['id'];
-if (isset($_POST['id'])) {
- $id = $_POST['id'];
-}
-
-if ($_GET['act'] == "del") {
- if ($_GET['type'] == 'php') {
- if ($a_phpservice[$_GET['id']]) {
- unset($a_phpservice[$_GET['id']]);
- write_config();
- phpservice_sync_package();
- header("Location: phpservice_php.php");
- exit;
- }
- }
-}
-
-if (isset($id) && $a_phpservice[$id]) {
-
- $pconfig['name'] = $a_phpservice[$id]['name'];
- $pconfig['php'] = base64_decode($a_phpservice[$id]['php']);
- $pconfig['enabled'] = $a_phpservice[$id]['enabled'];
- $pconfig['description'] = $a_phpservice[$id]['description'];
-
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- if (!$input_errors) {
-
- $ent = array();
- $ent['name'] = $_POST['name'];
- $ent['php'] = base64_encode($_POST['php']);
- $ent['enabled'] = $_POST['enabled'];
- $ent['description'] = $_POST['description'];
-
- if (isset($id) && $a_phpservice[$id]) {
- //update
- $a_phpservice[$id] = $ent;
- }
- else {
- //add
- $a_phpservice[] = $ent;
- }
-
- write_config();
- phpservice_sync_package();
-
- header("Location: phpservice_php.php");
- exit;
- }
-}
-
-include("head.inc");
-
-?>
-
-<script type="text/javascript" language="JavaScript">
-
-function show_advanced_config() {
- document.getElementById("showadvancedbox").innerHTML='';
- aodiv = document.getElementById('showadvanced');
- aodiv.style.display = "block";
-</script>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">PHP Service: Edit</p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-
-
-<div id="mainlevel">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabnavtbl">
-<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/packages/phpservice/phpservice_php.php");
- display_top_tabs($tab_array);
-
-?>
-</td></tr>
-</table>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
-
- <!--
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td><p><span class="vexpl"><span class="red"><strong>PHP<br>
- </strong></span>
- </p></td>
- </tr>
- </table>
- -->
- <br />
-
- <form action="phpservice_php_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
-
- <tr>
- <td width="25%" valign="top" class="vncellreq">Name</td>
- <td width="75%" class="vtable">
- <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>">
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell">PHP</td>
- <td width="78%" class="vtable">
- <?php
- echo "<textarea name=\"php\" id=\"php\" cols=\"70\" rows=\"15\" wrap=\"off\">".htmlspecialchars($pconfig['php'])."</textarea>\n";
- ?>
- <!--
- <br>
- <select name='dialplan_expression_select' id='dialplan_expression_select' onchange="document.getElementById('dialplan_expression').value += document.getElementById('dialplan_expression_select').value + '\n';" class='formfld'>
- <option></option>
- <option value='snortkillsessions'>snort kill sessions</option>
- </select>
- <span class="vexpl">
- <br />
- </span>
- -->
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Enabled</td>
- <td width="78%" class="vtable">
- <?php
- echo " <select name='enabled' class='formfld'>\n";
- echo " <option></option>\n";
- switch (htmlspecialchars($pconfig['enabled'])) {
- case "true":
- echo " <option value='true' selected='yes'>true</option>\n";
- echo " <option value='false'>false</option>\n";
- break;
- case "false":
- echo " <option value='true'>true</option>\n";
- echo " <option value='false' selected='yes'>false</option>\n";
-
- break;
- default:
- echo " <option value='true' selected='yes'>true</option>\n";
- echo " <option value='false'>false</option>\n";
- }
- echo " </select>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="25%" valign="top" class="vncellreq">Description</td>
- <td width="75%" class="vtable">
- <input name="description" type="text" class="formfld" id="description" size="40" value="<?=htmlspecialchars($pconfig['description']);?>">
- <br><span class="vexpl">Enter the description here.<br></span>
- </td>
- </tr>
-
- <tr>
- <td valign="top">&nbsp;</td>
- <td>
- <input name="Submit" type="submit" class="formbtn" value="Save"> <input class="formbtn" type="button" value="Cancel" onclick="history.back()">
- <?php if (isset($id) && $a_phpservice[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
-
- <br>
- <br>
- <br>
- <br>
- <br>
- <br>
-
- </td>
- </tr>
-</table>
-
-</div>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/routed/routed.inc b/config/routed/routed.inc
index f7ace8a5..471c2772 100644
--- a/config/routed/routed.inc
+++ b/config/routed/routed.inc
@@ -1,8 +1,9 @@
<?php
-/* $Id$ */
/*
routed.inc
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2006 Bill Marquette
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -25,39 +26,42 @@
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-
*/
-
function setup_routed() {
global $config;
$gw = "";
- if (!is_array($config['installedpackages']['routed']))
+ if (!is_array($config['installedpackages']['routed'])) {
return;
- if (!is_array($config['installedpackages']['routed']['config']))
+ }
+ if (!is_array($config['installedpackages']['routed']['config'])) {
return;
+ }
if (isset($config['installedpackages']['routed']['config'][0]['enable']) &&
- $config['installedpackages']['routed']['config'][0]['enable'] == "on") {
+ $config['installedpackages']['routed']['config'][0]['enable'] == "on") {
/* if user selected individual interfaces */
$ifarr = array_flip(explode(",", $config['installedpackages']['routed']['config'][0]['iface_array']));
$allifs = get_interface_arr();
if (!empty($ifarr)) {
- foreach($allifs as $ifname) {
+ foreach ($allifs as $ifname) {
$friendly_ifname = convert_real_interface_to_friendly_interface_name($ifname);
- if (array_key_exists($friendly_ifname, $ifarr))
+ if (array_key_exists($friendly_ifname, $ifarr)) {
$gw .= setup_etc_gateways($ifname, 'enable');
- else
+ } else {
$gw .= setup_etc_gateways($ifname, 'disable');
+ }
}
- } else
+ } else {
/* setup for all interfaces */
$gw = setup_etc_gateways();
+ }
conf_mount_rw();
file_put_contents("/etc/gateways", $gw);
- conf_mount_ro();
- restart_routed();
- } else
- stop_routed();
+ conf_mount_ro();
+ restart_service("routed");
+ } else {
+ stop_service("routed");
+ }
}
function setup_etc_gateways($iface="", $mode="") {
@@ -66,52 +70,56 @@ function setup_etc_gateways($iface="", $mode="") {
$ret = "";
if ($iface != "") {
$realif=convert_friendly_interface_to_real_interface_name($iface);
- if (!empty($realif))
+ if (!empty($realif)) {
$ret = "if={$realif} ";
+ }
}
switch($mode) {
- case "enable":
- if ($config['installedpackages']['routed']['config'][0]['ripversion'] == "2") {
- $ret .= "ripv2 ";
- $passwd = $config['installedpackages']['routed']['config'][0]['passwd'];
- if ($passwd != "") {
- $ret .= "passwd={$passwd} ";
- }
- $add_no_ag = $config['installedpackages']['routed']['config'][0]['enable_no_ag'];
- $add_no_super_ag = $config['installedpackages']['routed']['config'][0]['enable_no_super_ag'];
- if($add_no_ag == "on") {
- $ret .= "no_ag ";
- }
- if($add_no_super_ag == "on") {
- $ret .= "no_super_ag ";
+ case "enable":
+ if ($config['installedpackages']['routed']['config'][0]['ripversion'] == "2") {
+ $ret .= "ripv2 ";
+ $passwd = $config['installedpackages']['routed']['config'][0]['passwd'];
+ if ($passwd != "") {
+ $ret .= "passwd={$passwd} ";
+ }
+ $add_no_ag = $config['installedpackages']['routed']['config'][0]['enable_no_ag'];
+ $add_no_super_ag = $config['installedpackages']['routed']['config'][0]['enable_no_super_ag'];
+ if ($add_no_ag == "on") {
+ $ret .= "no_ag ";
+ }
+ if ($add_no_super_ag == "on") {
+ $ret .= "no_super_ag ";
+ }
}
- }
- break;
- case "disable":
- $ret .= "no_rip_out no_solicit no_rdisc no_rdisc_adv";
- break;
-
- default:
- break;
-
+ break;
+ case "disable":
+ $ret .= "no_rip_out no_solicit no_rdisc no_rdisc_adv";
+ break;
+ default:
+ break;
}
$ret .= "\n";
return $ret;
}
-function start_routed() {
- mwexec_bg("/sbin/routed");
-}
-
-function stop_routed() {
- killbyname("routed");
+function routed_install_command() {
+ conf_mount_rw();
+ write_rcfile(array(
+ "file" => "routed.sh",
+ "start" => "/usr/bin/nohup /sbin/routed > /dev/null 2>&1 &",
+ "stop" => "/bin/pkill routed"
+ )
+ );
+ conf_mount_ro();
}
-function restart_routed() {
- stop_routed();
- start_routed();
+function routed_deinstall_command() {
+ stop_service("routed");
+ conf_mount_rw();
+ unlink_if_exists("/usr/local/etc/rc.d/routed.sh");
+ conf_mount_ro();
}
?>
diff --git a/config/routed/routed.xml b/config/routed/routed.xml
index 8764b172..b38d7ee3 100644
--- a/config/routed/routed.xml
+++ b/config/routed/routed.xml
@@ -1,51 +1,65 @@
<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
- /* $Id$ */
- /*
- part of pfSense (https://www.pfsense.org/)
+<![CDATA[
+/* $Id$ */
+/* ====================================================================================== */
+/*
+ routed.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2006 Bill Marquette <bill.marquette@gmail.com>
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+*/
+/* ====================================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
- Copyright (C) 2006 Bill Marquette - bill.marquette@gmail.com.
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/* ====================================================================================== */
+ ]]>
</copyright>
<name>routed</name>
- <version>1.1</version>
+ <version>1.2</version>
<title>Services: RIP</title>
<include_file>/usr/local/pkg/routed.inc</include_file>
-
<additional_files_needed>
<item>https://packages.pfsense.org/packages/config/routed/routed.inc</item>
</additional_files_needed>
-
- <!-- Menu is where this packages menu will appear -->
<menu>
<name>RIP</name>
<section>Services</section>
<configfile>routed.xml</configfile>
<url>pkg_edit.php?xml=routed.xml&amp;id=0</url>
</menu>
+ <service>
+ <name>routed</name>
+ <rcfile>routed.sh</rcfile>
+ <executable>routed</executable>
+ <description>Routing Information Protocol Daemon</description>
+ </service>
<tabs>
<tab>
<text>ROUTED Settings</text>
@@ -53,16 +67,12 @@
<active/>
</tab>
</tabs>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
<configpath>['installedpackages']['routed']['config']</configpath>
- <!-- fields gets invoked when the user adds or edits a item. the following items
- will be parsed and rendered for the user as a gui with input, and selectboxes. -->
<fields>
<field>
<fielddescr>Enable RIP</fielddescr>
<fieldname>enable</fieldname>
- <description>Enables the Routing Information Protocol daemon</description>
+ <description>Enables the Routing Information Protocol daemon.</description>
<type>checkbox</type>
<enablefields>iface_array[],ripversion,passwd,enable_no_ag,enable_no_super_ag</enablefields>
</field>
@@ -73,7 +83,7 @@
<multiple>true</multiple>
<size>3</size>
<type>interfaces_selection</type>
- <description>Select the interfaces that RIP will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description>
+ <description>Select the interfaces that RIP will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description>
<required />
</field>
<field>
@@ -91,36 +101,30 @@
<field>
<fielddescr>RIPv2 password</fielddescr>
<fieldname>passwd</fieldname>
- <description>Specify a RIPv2 password. This password will be sent
- in the clear on all RIPv2 responses received and sent.
- </description>
+ <description>Specify a RIPv2 password. This password will be sent in the clear on all RIPv2 responses received and sent.</description>
<type>input</type>
</field>
<field>
<fielddescr>no_ag</fielddescr>
<fieldname>enable_no_ag</fieldname>
- <description>turns off aggregation of subnets in RIPv1 and RIPv2 responses.</description>
+ <description>Turns off aggregation of subnets in RIPv1 and RIPv2 responses.</description>
<type>checkbox</type>
</field>
<field>
<fielddescr>no_super_ag</fielddescr>
<fieldname>enable_no_super_ag</fieldname>
- <description>turns off aggregation of networks into supernets in RIPv2 responses.</description>
+ <description>Turns off aggregation of networks into supernets in RIPv2 responses.</description>
<type>checkbox</type>
</field>
</fields>
<aftersaveredirect>pkg_edit.php?xml=routed.xml&amp;id=0</aftersaveredirect>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_delete_php_command>
- </custom_delete_php_command>
<custom_php_resync_config_command>
- conf_mount_rw();
setup_routed();
- conf_mount_ro();
</custom_php_resync_config_command>
<custom_php_install_command>
+ routed_install_command();
</custom_php_install_command>
<custom_php_deinstall_command>
+ routed_deinstall_command();
</custom_php_deinstall_command>
</packagegui>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index a57d137a..a000911f 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -337,7 +337,7 @@
<category>Services</category>
<pkginfolink>https://doc.pfsense.org/index.php/PHPService</pkginfolink>
<config_file>https://packages.pfsense.org/packages/config/phpservice/phpservice.xml</config_file>
- <version>0.4.2</version>
+ <version>0.5.0</version>
<status>Beta</status>
<required_version>2.2</required_version>
<maintainer>markjcrane@gmail.com</maintainer>
@@ -426,7 +426,7 @@
<category>Network Management</category>
<port_category>net</port_category>
<config_file>https://packages.pfsense.org/packages/config/routed/routed.xml</config_file>
- <version>1.1</version>
+ <version>1.2</version>
<status>Stable</status>
<required_version>2.2</required_version>
<configurationfile>routed.xml</configurationfile>
@@ -722,7 +722,7 @@
<descr>VMware Tools is a suite of utilities that enhances the performance of the virtual machine's guest operating system and improves management of the virtual machine.</descr>
<website>http://open-vm-tools.sourceforge.net/</website>
<category>Services</category>
- <version>1280544_10</version>
+ <version>1280544.11</version>
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Open_VM_Tools_package</pkginfolink>
<required_version>2.2</required_version>
@@ -929,7 +929,7 @@
<website>http://bandwidthd.sourceforge.net/</website>
<descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr>
<category>System</category>
- <version>0.5</version>
+ <version>0.6</version>
<status>BETA</status>
<required_version>2.2</required_version>
<depends_on_package_pbi>bandwidthd-2.0.1_6-##ARCH##.pbi</depends_on_package_pbi>
@@ -1397,7 +1397,7 @@
<descr>Bacula is a set of Open Source computer programs that permit managings backups, recovery, and verification of computer data across a network of computers of different kinds.</descr>
<website>http://www.bacula.org/</website>
<category>Services</category>
- <version>7.0.5 pkg v 1.0.7</version>
+ <version>1.0.8</version>
<status>Stable</status>
<required_version>2.2</required_version>
<config_file>https://packages.pfsense.org/packages/config/bacula-client/bacula-client.xml</config_file>