aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit GUERIN <bguerin@netceler.com>2012-08-29 08:24:59 +0200
committerBenoit GUERIN <bguerin@netceler.com>2012-08-29 08:24:59 +0200
commit9ef793166596542a282d00b8c2a45acd1e53a7e0 (patch)
tree923a216e8c8659f6957a7cf81367889a3b7c9e54
parentbd190c0d57fa5ea228dfacbceccf4d9249ee8c69 (diff)
downloadpfsense-packages-9ef793166596542a282d00b8c2a45acd1e53a7e0.tar.gz
pfsense-packages-9ef793166596542a282d00b8c2a45acd1e53a7e0.tar.bz2
pfsense-packages-9ef793166596542a282d00b8c2a45acd1e53a7e0.zip
Adding option to disable IP monitoring
-rw-r--r--config/tinydns/tinydns.inc28
-rw-r--r--config/tinydns/tinydns.xml14
2 files changed, 31 insertions, 11 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc
index 7c8f15d7..70e149e1 100644
--- a/config/tinydns/tinydns.inc
+++ b/config/tinydns/tinydns.inc
@@ -53,12 +53,13 @@ function tinydns_custom_php_install_command() {
log_error("Could not open /usr/local/etc/rc.d/svscan.sh for writing.");
return;
}
-
+
// Ensure svscan.sh has a+rx
exec("chmod a+rx /usr/local/etc/rc.d/svscan.sh");
-
+
$ipaddress = $config['installedpackages']['tinydns']['config'][0]['ipaddress'];
+ $enableipmonitoring = $config['installedpackages']['tinydns']['config'][0]['enableipmonitoring'];
if($config['installedpackages']['tinydns']['config'][0]['refreshinterval'])
$refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval'];
@@ -91,7 +92,14 @@ svscan_start () {
/usr/bin/env \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
/usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/multilog t \$logdir" > /dev/null
+EOD;
+if ($enableipmonitoring) {
+ $svscan .= <<<EOD
minicron {$refreshinterval} {$g['varrun_path']}/ping_hosts.pid "/etc/ping_hosts.sh; cd {$g['varetc_path']}/tinydns/root && /usr/local/bin/tinydns-data"
+EOD;
+}
+$svscan .= <<<EOD
+
}
svscan_stop_post () {
@@ -111,9 +119,11 @@ EOD;
<?php
require_once(\"/usr/local/pkg/tinydns.inc\");
tinydns_custom_php_changeip_command();
- tinydns_create_zone_file();
- tinydns_setup_ping_items();
-?>
+ tinydns_create_zone_file();\n";
+ if ($enableipmonitoring) {
+ $start .= "tinydns_setup_ping_items();\n";
+ }
+ $start .= "?>
ENDPHP\n";
$stop = "";
@@ -617,7 +627,9 @@ function tinydns_sync_on_changes() {
tinydns_do_xmlrpc_sync($sync_to_ip, $password);
}
tinydns_create_zone_file();
- tinydns_setup_ping_items();
+ if ($config['installedpackages']['tinydns']['config'][0]['enableipmonitoring']) {
+ tinydns_setup_ping_items();
+ }
log_error("[tinydns] tinydns_xmlrpc_sync.php is ending.");
}
@@ -685,7 +697,9 @@ function tinydns_do_xmlrpc_sync($sync_to_ip, $password) {
$execcmd = "require_once('/usr/local/pkg/tinydns.inc');\n";
$execcmd .= "tinydns_custom_php_changeip_command();\n";
$execcmd .= "tinydns_create_zone_file();\n";
- $execcmd .= "tinydns_setup_ping_items();\n";
+ if ($config['installedpackages']['tinydns']['config'][0]['enableipmonitoring']) {
+ $execcmd .= "tinydns_setup_ping_items();\n";
+ }
/* assemble xmlrpc payload */
$params = array(
diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml
index b90a2cb3..546980f1 100644
--- a/config/tinydns/tinydns.xml
+++ b/config/tinydns/tinydns.xml
@@ -194,7 +194,7 @@
<fieldname>regdhcpstatic</fieldname>
<description>Register static DHCP leases with TinyDNS server using the Fully Qualified Domain Name specified in System: General.</description>
<type>checkbox</type>
- </field>
+ </field>
<field>
<fielddescr>Register DHCP leases with server</fielddescr>
<fieldname>regdhcp</fieldname>
@@ -203,8 +203,14 @@
</field>
<field>
<type>listtopic</type>
- <name>Monitoring IP refresh interval</name>
- <fieldname>temp</fieldname>
+ <name>IP Monitoring</name>
+ <fieldname>temp</fieldname>
+ </field>
+ <field>
+ <fielddescr>Enable IP monitoring</fielddescr>
+ <fieldname>enableipmonitoring</fieldname>
+ <description>Wheather or not to monitor IP address</description>
+ <type>checkbox</type>
</field>
<field>
<fielddescr>Refresh Interval</fielddescr>
@@ -215,7 +221,7 @@
<field>
<type>listtopic</type>
<name>Sync TinyDNS settings via XMLRPC</name>
- <fieldname>temp</fieldname>
+ <fieldname>temp</fieldname>
</field>
<field>
<fielddescr>XMLRPC Sync</fielddescr>