Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE menu checkbox feature possible?
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 


Messages In This Thread
RE: menu.c32 options? - robinsmidsrod - 2016-03-17 12:36



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