How to write a simple ttl script macro
Tera Term is an open source terminal which is similar to putty. It supports a Script Language called "Tera Term Language" or "macro" which can be used to automate the CLI based user action. Using this script we can do a lot of automation. The beauty of this script are that these script will be running in host computer and commands are executed on the target.Which means even the target goes for reboot the scipt will be still running and even we can capture/ automate certain tasks which involves reboot.Also no matter whatever the target we can develop script as these scripts are running in the hosts (windows).
Advantages over other scripting language;
How to Use it:
Sample TTL Script:
Note: semicolon (;) is the comment for TTL Script
Tera Term Site:
https://ttssh2.osdn.jp/
Tera Term Command Reference:
https://ttssh2.osdn.jp/manual/en/macro/command/index.html
Advantages over other scripting language;
- Target Platform Independent
- Able to continue to run even after reboot
- Changes in the target is not required
- Supported over serial,ssh,telnet connections.
Executing a TTL Script |
- Establish a serial/telnet/ssh connection by setting up the baud rates.
- Launch the ttl script by going to Control -> Macro and load the script. (you can even automate this by adding a startup macro)
- You can also pause this script while running
Lauching the ttl script |
Sample TTL Script:
;------------------------------------------------------------------------ ;Developed By: ; Vaneeswaran N ; www.vaneeswaran.com ;------------------------------------------------------------------------ connect '/C=10' ;connect to com port 10 UsernamePrompt = 'login:' ; setting username prompt Username = 'root' ; variable to hold the username value PasswordPrompt = ' ' ; setting username prompt Password = 'admin@123' ; variable to hold the password ; running an infinite while loop so whenever login reboot happens it will b automatically logged in while 1 wait UsernamePrompt ;waiting for the userpromt sendln Username ;feeding the username once prompts wait PasswordPrompt sendln Password endwhile ;auto login complete.
Note: semicolon (;) is the comment for TTL Script
Tera Term Site:
https://ttssh2.osdn.jp/
Tera Term Command Reference:
https://ttssh2.osdn.jp/manual/en/macro/command/index.html