09-02-2020 08:54 AM
hi I have built a menu with 6 options, number 6 being the default to exit, however what i want to happen is when the user chooses option 1 for instance it runs the embedded tcl but instead of returning to the menu again after i want it to automatically exit back to the router prompt. how can i go about achieving this.?
the menu and scripts all work fine i just want it to auto exit after executing selection
Solved! Go to Solution.
09-02-2020 11:25 AM
have now resolved this myself
09-02-2020 09:26 AM
using the cisco version as an example how would i get it to exit after completing an option rather than returning to the menu once again to then select option 4 to exit
I have tried with embededTCL and entering end / exit and tclquit but this just runs it but then returns to the menu once complete.
I have set the continue prompt to false so it will just run without prompt, i just need it to be able to exit the menu structure automatically once done and go back to the router prompt.
<?xml version="1.0" encoding="UTF-8"?>
<Menu Standalone="true" TitleJustification="CENTER" Main="true"
MenuName="Test" schemaVersion="1.1">
<MenuTitle>
<EmbTCLValue>
<TCLCommand>return [concat "Simple Example Menu for" [hostname]]
</TCLCommand>
</EmbTCLValue>
</MenuTitle>
<Item ContinuePrompt="true" ItemJustification="LEFT">
<ItemTitle>
<Constant String="Show Cisco IOS version" />
</ItemTitle>
<HelpString>
<Constant String="This will run the exec command 'show ver'"/>
</HelpString>
<IOSExecCommand>"show ver"</IOSExecCommand>
</Item>
<Item ContinuePrompt="false" ItemJustification="LEFT">
<ItemTitle>
<EmbTCLValue>
<TCLCommand>return "Change hostname"</TCLCommand>
</EmbTCLValue>
</ItemTitle>
<HelpString>
<Constant String="Selecting this will change the router
hostname."/>
</HelpString>
<Wizard>
<QueryPrompt>
<Constant String="Please enter new hostname"/>
</QueryPrompt>
<FreeForm MaxResponse="30" />
</Wizard>
<IOSConfigCommand>"hostname $r(1)"</IOSConfigCommand>
</Item>
<Item ContinuePrompt="false" ItemJustification="LEFT">
<ItemTitle>
<Constant String="Change enable password" />
</ItemTitle>
<HelpString>
<Constant String="Selecting this will run enable password 0 'new_password'"/>
</HelpString>
<Wizard>
<QueryPrompt>
<Constant String="Please enter new password"/>
</QueryPrompt>
<FreeForm InputMask="TRUE" />
</Wizard>
<IOSConfigCommand>"enable password 0 $r(1)"</IOSConfigCommand>
</Item>
<Item ContinuePrompt="true" ItemJustification="LEFT">
<ItemTitle>
<Constant String="Exit" />
</ItemTitle>
</Item>
<DefaultSelection>
<Constant String="4" />
</DefaultSelection>
</Menu>
09-02-2020 11:25 AM
have now resolved this myself
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide