The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Few scripting questions
2015-10-22, 23:22 (This post was last modified: 2015-10-22 23:37 by SoulA.)
Post: #1
Few scripting questions
I'm trying to enumerate interfaces from within iPXE. I figured I could loop through each one doing "dhcp net${i}", then looking for info on the NIC like "${netX/dhcp-server}" and finally closing the interface with "ifclose net${i}".

I would like to skip over the interface that iPXE used when initially booting. The problem is I'm not seeing a way to get the name or even index of the current interface. Something like "${netX/ip}" except "${netX/index}" which returns "net0" for example.

Anything like this available that I'm just not seeing?

Second problem is there is the possibility that in our setup iPXE might be waiting around on a menu screen and intermittently checking an HTTP server for any boot instructions. Since iPXE doesn't have anything built into renew it's DHCP address before it's lease expires I figured I could do "dhcp net0" (also needs the index above) which seems to renew it just fine.

The problem with this is after doing that it seems to break being able to do relative paths in scripts. The reason we need to renew is I don't want the DHCP server to hand out another lease with the same IP.
Some psuedo code of what a script might look like for the interface enumeration http://pastebin.com/TRnAMkR5.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Few scripting questions - SoulA - 2015-10-22 23:22



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