diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-12-08 19:57:46 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-12-08 19:57:46 +0000 |
commit | 85c3632a43d7b0b895edf55fc574db3e9e06ece5 (patch) | |
tree | 42f2acc064f2749e780a249912fd9f75c3c46fe1 /packages | |
parent | 8141cedce657a26146444c1e8c955ffd9be607a8 (diff) | |
download | pfsense-packages-85c3632a43d7b0b895edf55fc574db3e9e06ece5.tar.gz pfsense-packages-85c3632a43d7b0b895edf55fc574db3e9e06ece5.tar.bz2 pfsense-packages-85c3632a43d7b0b895edf55fc574db3e9e06ece5.zip |
Add option to turn ping_hosts.sh into a every minute event in cron
Diffstat (limited to 'packages')
-rw-r--r-- | packages/tinydns/tinydns.inc | 14 | ||||
-rw-r--r-- | packages/tinydns/tinydns.xml | 6 |
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> |