source: llx-bootmanager/trunk/fuentes/install.llx-bootmanager/usr/share/llxbootmanager/www-boot/boot.php @ 415

Last change on this file since 415 was 415, checked in by hectorgh, 4 years ago

adding project files

File size: 1.3 KB
Line 
1<?php
2
3header ( "Content-type: text/plain" );
4echo "#!gpxe\n";
5
6#GET VARS
7$MANUFACTURER=$_GET["manufacturer"];
8$PRODUCT=$_GET["product"];
9$IP=$_GET["ip"];
10$MAC=$_GET["mac"];
11
12$proto = "https";
13// Comment out/remove the following if strictly using HTTPS
14if (!isset($_SERVER["HTTPS"]))
15  $proto = "http";
16
17// This assigns the host that gPXE should use using the most logical variables
18if ( $_SERVER["HTTP_HOST"] != "" ) {
19  $host=$_SERVER["HTTP_HOST"];
20} else {
21  if ( $_SERVER["SERVER_NAME"] != 0) {
22        $host=$_SERVER["SERVER_NAME"];
23  } else {
24        $host=$_SERVER["SERVER_ADDR"];
25  }
26}
27
28// Comment out/remove the following if you are running on a standard port
29if (!((! isset($_SERVER["HTTPS"]) ) && ($_SERVER["SERVER_PORT"] == 80))
30  && !(isset($_SERVER["HTTPS"]) && ($_SERVER["SERVER_PORT"] == 443)) ){
31    if (strrpos($host, ":") == FALSE)
32      $host=$host.":".$_SERVER["SERVER_PORT"];
33}
34
35$uri=$_SERVER["REQUEST_URI"];
36$dir=substr ( $uri, 0, strrpos ($uri, "/") + 1);
37
38echo "#!gpxe\n";
39echo "imgfree\n";
40/*echo "login\n";*/
41$url="bootcfg.php?mac=$MAC&manufacturer=".preg_replace('/\s+/', '',$MANUFACTURER)."&product=".preg_replace('/\s+/', '',$PRODUCT)."&ip=$IP";
42echo "set 209:string ".$url."\n";
43echo "set 210:string ".
44     $proto."://\${username:uristring}:\${password:uristring}@".
45     $host.$dir."\n";
46echo "chain \${210:string}pxe/pxelinux.0\n";
47?>
Note: See TracBrowser for help on using the repository browser.