aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/tinydns/tinydns.inc14
-rw-r--r--packages/tinydns/tinydns.xml6
2 files changed, 20 insertions, 0 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 0f9c9658..4a461181 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -110,6 +110,7 @@ function tinydns_custom_php_changeip_command() {
global $g, $config;
conf_mount_rw();
$ip = $config['installedpackages']['tinydns']['config'][0]['ipaddress'];
+ $updatecron = $config['installedpackages']['tinydns']['config'][0]['updatecron'];
/* setup daemon tools service area */
exec("/usr/sbin/pw useradd Gtinydns");
exec("/usr/sbin/pw useradd Gdnslog");
@@ -117,6 +118,19 @@ function tinydns_custom_php_changeip_command() {
exec("/bin/ln -s /etc/tinydns /service");
sleep(5);
exec("/usr/local/bin/svstat /service/tinydns");
+ if($updatecron) {
+ $text_1 = "*/1 * * * * root /usr/bin/nice -n20 /etc/ping_hosts.sh";
+ $text_5 = "*/5 * * * * root /usr/bin/nice -n20 /etc/ping_hosts.sh";
+ $filenamea = "/etc/crontab";
+ remove_text_from_file($filenamea, $text_5);
+ add_text_to_file($filenamea, $text_1);
+ } else {
+ $text_1 = "*/1 * * * * root /usr/bin/nice -n20 /etc/ping_hosts.sh";
+ $text_5 = "*/5 * * * * root /usr/bin/nice -n20 /etc/ping_hosts.sh";
+ $filenamea = "/etc/crontab";
+ remove_text_from_file($filenamea, $text_1);
+ add_text_to_file($filenamea, $text_5);
+ }
conf_mount_ro();
}
diff --git a/packages/tinydns/tinydns.xml b/packages/tinydns/tinydns.xml
index 6a1af873..0c675616 100644
--- a/packages/tinydns/tinydns.xml
+++ b/packages/tinydns/tinydns.xml
@@ -68,6 +68,12 @@
<type>input</type>
</field>
<field>
+ <fieldname>updatecron</fieldname>
+ <fielddescr>Update cron</fielddescr>
+ <description>Changes cron to ping hosts every minute from 5.</description>
+ <type>input</type>
+ </field>
+ <field>
<fieldname>minsegment</fieldname>
<fielddescr>Minimum segment size</fielddescr>
<description>Recommended size: 10240 or larger.</description>