summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp_relay.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-06-01 02:29:35 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-06-01 02:29:35 +0000
commit96c03796d08d6e6b5634e8fd368200f9ccab1d77 (patch)
tree5e82940724374a39f8e5582939eefb772ee3f369 /usr/local/www/services_dhcp_relay.php
parenta17a51fa24465db9a058605029045eba632ac625 (diff)
downloadpfsense-96c03796d08d6e6b5634e8fd368200f9ccab1d77.zip
pfsense-96c03796d08d6e6b5634e8fd368200f9ccab1d77.tar.gz
Actually check that the file exists before returning to avoid this error:
Warning: file(/var/db/dhclient.leases): failed to open stream: No such file or directory in /usr/local/www/services_dhcp_relay.php on line 35
Diffstat (limited to 'usr/local/www/services_dhcp_relay.php')
-rwxr-xr-xusr/local/www/services_dhcp_relay.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php
index 01daadc..326a343 100755
--- a/usr/local/www/services_dhcp_relay.php
+++ b/usr/local/www/services_dhcp_relay.php
@@ -32,7 +32,10 @@
function get_wan_dhcp_server() {
global $config, $g;
$dhclientfn = $g['vardb_path'] . "/dhclient.leases";
- $leases = file($dhclientfn);
+ if(file_exists($dhclientfn))
+ $leases = file($dhclientfn);
+ else
+ $leases = array();
/* Start at the end, work backwards finding the latest lease for the WAN */
$dhcpserver = "";
$iface = "";
OpenPOWER on IntegriCloud