Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with iPXE and PHP
2012-12-05, 11:23 (This post was last modified: 2012-12-05 11:25 by Torgeir.)
Post: #4
RE: Issue with iPXE and PHP
Only thing I can think of:

I use this on top of every php page just like this:

PHP Code:
<?php 
# my red hat server did not like just <? 
# i had to have <?php
# <? has always work for me before

# these two always on top
header "Content-type: text/plain" );
echo 
"#!ipxe \n";

# then i do stuff like
$mac $_REQUEST['mac'];

if (
$mac "010101010") {
     
$client 1;
}

# chain statement has to end with \n too...
echo "chain http://SERVER_NAME/boot.php?client=$client \n";
?>

I use FQDN, even HTTPS and an embedded script like this:

Code:
#!ipxe
isset ${net0/mac} && dhcp net0 || goto net1
set dhcp_mac ${net0/mac}
chain https://SERVER-NAME.${domain}/first.stage.php?MAC=${dhcp_mac}&DHCPSERVER=${net0.dhcp/dhcp-server:ipv4}&NIC=net0&DOMAIN=${domain}&PRODUCT=${smbios/product:string}

:net1
isset ${net1/mac} && dhcp net1 || goto net2
set dhcp_mac ${net1/mac}
chain https://SERVER-NAME.${domain}/first.stage.php?MAC=${dhcp_mac}&DHCPSERVER=${net0.dhcp/dhcp-server:ipv4}&NIC=net1&DOMAIN=${domain}&PRODUCT=${smbios/product:string}

:net2
isset ${net2/mac} && dhcp net2 || goto nonet
set dhcp_mac ${net2/mac}
chain https://SERVER-NAME.${domain}/first.stage.php?MAC=${dhcp_mac}&DHCPSERVER=${net0.dhcp/dhcp-server:ipv4}&NIC=net2&DOMAIN=${domain}&PRODUCT=${smbios/product:string}

:nonet
echo
echo Error! Could not configure network.
echo
prompt Press any key to reboot . . .
reboot

Torgeir
Can you run this simple php script?
http://forum.ipxe.org/showthread.php?tid=6333

Its intended to go in an loop Smile

Torgeir
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Issue with iPXE and PHP - thomil - 2012-12-05, 01:19
RE: Issue with iPXE and PHP - NiKiZe - 2017-12-17, 11:27
RE: Issue with iPXE and PHP - Torgeir - 2012-12-05 11:23



User(s) browsing this thread: 2 Guest(s)