aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-01-28 04:50:50 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-01-28 04:50:50 +0000
commit2ecdb9b69134038b996841a437c7099f64e3c154 (patch)
treedb9d9fb2477c908206725d1aed3cf7bafb540895
parent356b821123c240f69f63c3329d3365eb4c6bea7a (diff)
downloadpfsense-packages-2ecdb9b69134038b996841a437c7099f64e3c154.tar.gz
pfsense-packages-2ecdb9b69134038b996841a437c7099f64e3c154.tar.bz2
pfsense-packages-2ecdb9b69134038b996841a437c7099f64e3c154.zip
Correctly return backup gateway host record
-rw-r--r--packages/tinydns/tinydns.inc25
1 files changed, 16 insertions, 9 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 37c3d542..ed024680 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -133,22 +133,22 @@ function tinydns_custom_php_changeip_command() {
exec("/bin/mkdir /service");
exec("/bin/ln -s /etc/tinydns /service/");
if($updatecron) {
- $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
- $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
+ $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
+ $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
$filenamea = "/etc/crontab";
remove_text_from_file($filenamea, $text_1);
remove_text_from_file($filenamea, $text_5);
add_text_to_file($filenamea, $text_1);
} else {
- $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
- $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
+ $text_1 = "*/1 * * * * root /etc/ping_hosts.sh";
+ $text_5 = "*/5 * * * * root /etc/ping_hosts.sh";
$filenamea = "/etc/crontab";
remove_text_from_file($filenamea, $text_1);
remove_text_from_file($filenamea, $text_5);
add_text_to_file($filenamea, $text_5);
}
- exec("killall cron");
- exec("cron");
+
+ exec("killall -HUP cron");
conf_mount_ro();
filter_configure();
}
@@ -183,7 +183,7 @@ function tinydns_get_backup_record($record) {
return $record;
foreach($domain['row'] as $row) {
$status = tinydns_get_record_status($row['failoverip']);
- if($status == "DOWN")
+ if($status == "UP")
return $row['failoverip'];
}
}
@@ -276,12 +276,19 @@ function tinydns_create_zone_file() {
$monitorip = $domain['monitorip'];
if($monitorip) {
$status = tinydns_get_record_status($monitorip);
- if($status == "DOWN")
+ if($status == "DOWN") {
+ if($debug)
+ log_error("$ipaddress monitor ip $monitorip is offline.");
$ipaddress = tinydns_get_backup_record($ipaddress);
+ if($debug)
+ log_error("tinydns_get_backup_record returned $ipaddress ");
+ }
}
$record_data = tinydns_get_rowline_data($ipaddress, $domain['recordtype'], $ttl, $hostname);
- if($record_data)
+ if($record_data) {
fwrite($fd, $record_data . "\n");
+ continue;
+ }
/* process load balanced items */
if($domain['row']) {
foreach($domain['row'] as $row) {