cancel
Showing results for 
Search instead for 
Did you mean: 

Script error; IF, ELSE, ENDIF

Script error; IF, ELSE, ENDIF

modris_bernands
New Contributor II
I'm newbie in scripts.
We reconfigure our network and I try make write script for that.
my simple script is:
set var vlanName $CLI.ARGV1
set var vlanDesc $CLI.ARGV2
set var tag $CLI.ARGV3
set var trunkport $CLI.ARGV4
if ($CLI.ARGC ! = 0) then
create vlan $vlanName description $vlanDesc
configure $vlanName tag $tag
configure $vlanName add ports $trunkport tagged
enable $vlanName
else
create log entry "error with $vlanName"
endifWhen I load script with 4 arguments and get errors:
* switch1.7 # load script createvlan.xsf vlan11 gram 11 46
Error:syntax error in expression "(4 ! = 0)"
Error: Mismatched ELSE
Error: Mismatched ENDIF
additional information:
* switch1.8 # show version
Switch : 800243-00-03 1031G-80649 Rev 3.0 BootROM: 1.0.3.5 IMG: 12.6.2.10
XGM2-1 :
Image : ExtremeXOS version 12.6.2.10 v1262b10-patch1-15 by release-manager on Tue Jun 5 19:05:37 EDT 2012
BootROM : 1.0.3.5
* switch1.9 # show switch
System Type: X350-48t
* switch1.10 # show licenses
Enabled License Level: L2 Edge
Enabled Feature Packs: Noneand surprisingly is that - after script execute it really create new vlan like I want, but these errors are confused me. and that indicate on my misunderstanding about this simple script.
without understanding simple i can't dig deeper 

Q in simple - why I get:
Error:syntax error in expression "(4 ! = 0)"
Error: Mismatched ENDIF Error: Mismatched ELSE
Thanks,
5 REPLIES 5

BrandonC
Extreme Employee
I'd check again after correcting the first error. The second errors look like they probably came from the "if" line erroring out.
GTM-P2G8KFN