forked from xbgmsharp/ipxe-buildweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.php
executable file
·25 lines (22 loc) · 877 Bytes
/
options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/*
#------------------------------------------------------------------------
# Dynamic iPXE image generator
#
# Copyright (C) 2012-2014 Francois Lacroix. All Rights Reserved.
# License: GNU General Public License version 3 or later; see LICENSE.txt
# Website: http://ipxe.org, https://github.com/xbgmsharp/ipxe-buildweb
# Support: [email protected]
#------------------------------------------------------------------------
*/
$cache_file = "/tmp/ipxeoptions";
$cache_life = '3600'; //caching time, in seconds, 1h
$filemtime = @filemtime($cache_file); // returns FALSE if file does not exist
if (!$filemtime or (time() - $filemtime >= $cache_life))
{
$outpout = exec("rm -f /tmp/ipxeoptions && cd /var/tmp/ipxe/src/ && perl /var/tmp/ipxe/src/util/parseheaders.pl 1> /tmp/ipxeoptions");
readfile("/tmp/ipxeoptions");
} else {
readfile("/tmp/ipxeoptions");
}
?>