diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-06-01 02:29:35 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-06-01 02:29:35 +0000 |
commit | 96c03796d08d6e6b5634e8fd368200f9ccab1d77 (patch) | |
tree | 5e82940724374a39f8e5582939eefb772ee3f369 /usr/local/www/services_dhcp_relay.php | |
parent | a17a51fa24465db9a058605029045eba632ac625 (diff) | |
download | pfsense-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-x | usr/local/www/services_dhcp_relay.php | 5 |
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 = ""; |