aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tinydns/tinydns.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-02-12 18:54:56 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-02-12 18:54:56 +0000
commit4d298ed193c2ca5d887b51c6165dc86f8e70f4c4 (patch)
tree72ae36a15ec28d4a948578c8d7cd182bc77047f5 /packages/tinydns/tinydns.inc
parentdc23039f635f04befb50e553da948bfb163421fb (diff)
downloadpfsense-packages-4d298ed193c2ca5d887b51c6165dc86f8e70f4c4.tar.gz
pfsense-packages-4d298ed193c2ca5d887b51c6165dc86f8e70f4c4.tar.bz2
pfsense-packages-4d298ed193c2ca5d887b51c6165dc86f8e70f4c4.zip
Fix bug:
Warning: file_get_contents(/var/db/pingmsstatus/XX.XXX.XXX.XXX): failed to open stream: No such file or directory in /usr/local/pkg/tinydns.inc on line 155
Diffstat (limited to 'packages/tinydns/tinydns.inc')
-rw-r--r--packages/tinydns/tinydns.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index ad6e14cc..f5e6c1f4 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -149,17 +149,22 @@ function tinydns_custom_php_changeip_command() {
function tinydns_get_record_status($record, $pingthreshold = "", $wanpingthreshold = "") {
global $g, $config;
if(file_exists("/var/db/pingstatus/{$record}")) {
+ $status = "";
$status = file_get_contents("/var/db/pingstatus/{$record}");
if(stristr($status,"DOWN"))
return "DOWN";
}
if($pingthreshold) {
- $current_ms = file_get_contents("/var/db/pingmsstatus/$record");
+ $current_ms = "";
+ if(file_exists("var/db/pingmsstatus/$record"))
+ $current_ms = file_get_contents("/var/db/pingmsstatus/$record");
if($pingthreshold > $current_ms)
return "DOWN";
}
if($wanpingthreshold) {
- $current_avg = file_get_contents("/var/db/wanaverage");
+ $current_avg = "";
+ if(file_exists("/var/db/wanaverage"))
+ $current_avg = file_get_contents("/var/db/wanaverage");
if($wanpingthreshold > $current_avg)
return "DOWN";
}