Phase 2: Upload text files through a Telnet session
In a previous post, I've described how you can use Tcl shell to upload text content into the router's flash if the router has no connectivity to a suitable file server (or you don't have FTP or TFTP server handy).
The trick works flawlessly, but typing the same obscure Tcl commands gets tedious after a while, so the first time I had to use this solution to develop a Tcl script, I quickly wrote another script that takes a file name as a parameter and hides all the other murky details.
To use it, transfer the contents of storeFile.tcl to the router's flash (using the previously described trick), follow the installation instructions in the Tcl source, and you're ready to go.
You can adapt the Tcl script to your needs; for example, you could add instructions to re-register the EEM Tcl policy every time you upload the new code.
RDWR mode, I get error when reading like:
error reading "file0": Unknown error 2577
But opening in readonly mode is fine.
Is it not possible to read and write file on disk [disk0:]