From cb53501d44312bccd147debb868056534f0d878b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 8 Dec 2006 17:17:30 +0000 Subject: * Hook into ping_hosts.sh * Reload zone database upon host down or up status --- packages/tinydns/tinydns.inc | 6 ++++-- packages/tinydns/tinydns.xml | 10 ++++++++++ packages/tinydns/tinydns_down.php | 37 +++++++++++++++++++++++++++++++++++++ packages/tinydns/tinydns_up.php | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 packages/tinydns/tinydns_down.php create mode 100644 packages/tinydns/tinydns_up.php diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc index d270171d..cc4371fa 100644 --- a/packages/tinydns/tinydns.inc +++ b/packages/tinydns/tinydns.inc @@ -153,6 +153,8 @@ function tinydns_setup_ping_items() { global $g, $config; if(!$config['installedpackages']['tinydnsdomains']) return; + $wanif = get_real_wan_interface(); + $ip = find_interface_ip($wanif); conf_mount_rw(); /* XXX: make this work with other packages */ $fd = fopen("/var/db/pkgpinghosts", "w"); @@ -164,10 +166,10 @@ function tinydns_setup_ping_items() { * status and create a database of the status information that we can use. */ foreach($config['installedpackages']['tinydnsdomains']['config'] as $domain) { - fwrite($fd, $domain['ipaddress'] . "\n"); + fwrite($fd, $ip . "|" . $domain['ipaddress'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php\n"); if($domain['row']) { foreach($domain['row'] as $row) { - fwrite($fd, $row['ipaddress'] . "\n"); + fwrite($fd, $ip . "|" . $row['ipaddress'] . "|3|/usr/local/pkg/tinydns_down.php|/usr/local/pkg/tinydns_up.php\n"); } } } diff --git a/packages/tinydns/tinydns.xml b/packages/tinydns/tinydns.xml index 7229d5c0..d5c75220 100644 --- a/packages/tinydns/tinydns.xml +++ b/packages/tinydns/tinydns.xml @@ -34,6 +34,16 @@ 077 http://www.pfsense.com/packages/config/tinydns/tinydns_filter.xml + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/tinydns/tinydns_down.php + + + /usr/local/pkg/ + 077 + http://www.pfsense.com/packages/config/tinydns/tinydns_up.php + tinydns_custom_php_install_command(); diff --git a/packages/tinydns/tinydns_down.php b/packages/tinydns/tinydns_down.php new file mode 100644 index 00000000..cdc9a088 --- /dev/null +++ b/packages/tinydns/tinydns_down.php @@ -0,0 +1,37 @@ +#!/usr/local/bin/php -f + \ No newline at end of file diff --git a/packages/tinydns/tinydns_up.php b/packages/tinydns/tinydns_up.php new file mode 100644 index 00000000..10a9201c --- /dev/null +++ b/packages/tinydns/tinydns_up.php @@ -0,0 +1,37 @@ +#!/usr/local/bin/php -f + \ No newline at end of file -- cgit v1.2.3