Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE menu checkbox feature possible?
2015-08-07, 04:24 (This post was last modified: 2016-03-17 12:47 by robinsmidsrod.)
Post: #1
iPXE menu checkbox feature possible?
Hello all. I wanted to ask everyone using ipxe if it's even possible to create checkbox type input for the user. So say you had several options for a server build you didn't necessarily want to create separate config files for. But just select able options during the install process and pass those menu options to the backend scripts.

I read someone you can do this with compiled menus but I can't seem to find that site again. If this is possible, can it be done dynamically?

Oh yes. If anyone has any samples or URL's that would be great too!

Thanks so much!

Glen
Find all posts by this user
Quote this message in a reply
2016-03-17, 12:36 (This post was last modified: 2016-03-17 12:43 by robinsmidsrod.)
Post: #2
RE: menu.c32 options?
It should be quite possible. You can make a dynamic menu where each menu item is a toogle variable, and you select the variable item to toggle it and finally use the "continue" menu item to start the process. Possibly something like this (untested):

Code:
#!ipxe
# Assign defaults
set var1 1
set var2 0
:render_menu
menu
iseq ${var1} 1 && item disable_var1 [x] Disable variable 1 ||
iseq ${var1} 0 && item  enable_var1 [ ] Enable variable 1 ||
iseq ${var2} 1 && item disable_var2 [x] Disable variable 2 ||
ideq ${var2} 0 && item  enable_var2 [ ] Enable variable 2 ||
item
item abort Abort process
item start Start process
choose selected && goto ${selected} || goto abort

:abort
exit

:enable_var1
set var1 1
goto render_menu

:disable_var1
set var1 0
goto render_menu

:enable_var2
set var2 1
goto render_menu

:disable_var2
set var2 0
goto render_menu

:start
echo Variable 1: ${var1}
echo Variable 2: ${var2}
chain http://myserver/myscript.php?var1=${var1}&var2=${var2}
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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