I'm having an extremely difficult time finding a simple example of how to run a TCL script during the autoinstall process. I'm hoping this discussion will provide a simple answer as to how to do this. I'm going to strip this down to keep it simple.
I created a test.tcl file. When my new switches boot, through DHCP options and TFTP, they download the script via the bootfile-name option. The switches then try to run the script, which is then failing. Below is both the script and the error. In this example, I am attempting to just configure the enable password on the switch and be done. Super super simple script. No fancy code.
Loading cfgssh.tcl from 192.168.89.41 (via Vlan1): !
[OK - 380 bytes]
ios_config "enable secret cisco"
^
% Invalid input detected at '^' marker.
Apr 12 16:34:20.753: %PARSER-4-BADCFG: Unexpected end of configuration file.
Apr 12 16:34:20.753: %SYS-5-CONFIG_I: Configured from tftp://192.168.89.41/cfgssh.tcl by console
I looked up the error and it said there could be blank white space causing the issue. There is no blank white space.
TCL File ..............
ios_config "enable secret cisco"
^That's it... just want to keep it simple.
Thank you for your future responses.