Header Only - DO NOT REMOVE - Extreme Networks

Prompt for input / edit script?

  • 7 January 2014
  • 2 replies

Userlevel 4
Create Date: Aug 23 2012 8:29AM

I am writing a 'default' config script, basically to apply all of our default settings for a switch.

What i would like to do, but can do without, is to prompt the users for a number and assign that number as the IP of the switch.

command equiv:
configure vlan VLAN-Default ipa 192.168.1.X

I know i can make a variable and think i could apply the variable to the command, however i am not sure if it is possible to interupt a script to ask for input / resume script.

I want to know if during a script i can prompt the user to enter a number and apply that number to X / then execute that command and move on.

Alternatively I can tell users to just edit the script each time and change the IP to whatever it needs to be (not use a variable). I want to IP the switch as part of the general config so that i can also add default route, dns, etc (at least the default route won't enter until the vlan is IP'd).

(from Nick_Lindhag)

2 replies

Userlevel 4
Create Date: Aug 23 2012 9:45AM

For prompting of variables at the command line.

set var myVar $READ(Description.)

Hope this helps (from john_padilla)
Userlevel 4
Create Date: Aug 26 2012 6:25PM

OR, if you need only one (or two) variables - you can pass them to the script as parameters (using $CLI.ARGV1 ..."load script myScript variable1 variable2")

For more variables, the GUI version is the best one; $READ works anytime so it will be your call in the end. (from Eugen_NAIMAN)