Good afternoon... I am hoping that this is a quick question.. I have been through a lot of post here and the help for getting a working config script to upgrade my Cisco IOS devices has been great. I need to add one tweak to a script. I have a lot of switch stacks at one location. Some are running the image version we want to standardize on and others are not. I have all of the switch stacks at this location in an NCM group.
I would like to add one more piece of logic to my script so that the only devices that are upgraded are the stacks that are not running the image we want to standardize on. Right now I am using the script below and trying to add the line in red as a second condition. This is just in case a node that is running the proper image is selected it won't be upgraded. But when I add the second line the script fails.
Any suggestions on how to add a second condition to the script?
string @CommandLine = 'archive download-sw /overwrite tftp://$@{StorageAddress}/' + @IOS_FILENAME
//Make sure there are no spaces in filename
if (@IOS_FILENAME contains ' ')
{}
else
{
foreach ( @node in @ContextNode )
{
if ( @node.Vendor == 'Cisco' )
if ( @Node.SysDescr contains 'Cisco IOS Software, Version 12.2' )
{
CLI
{
@CommandLine
}
}
}
}
}