Here a quick and dirty bash-script, showing how you could automate some configuration tasks to be done in a menu-based telnet session. E.g. to do some configurations on a cmc-unit.
This script sets and enables the NTP-server on a cmc-unit. Be careful with the newline-characters. Sometimes you might need more sleep-time...
1. !/bin/sh
tpipe()
{
sleep 1
echo -en "cmc\n";
sleep 1
echo -en "xyz\n";
sleep 1
echo -en "1" #1 Network Configuration
echo -en "4" #4 NTP Configuration
echo -en "1" #1 Enable NTP
echo -en "e\n"
echo -en "2" #2 IP Addr.NTP Server 1
echo -en "\177172.25.2.11\n"
echo -en "4" #4 NTP Offset to UTC
echo -en "0\n" #=0 Dublin,Lisbon,London
echo -en "4" #4 NTP Offset to UTC
echo -en "+\n" #=+1 Amsterdam,Berlin,Rome
echo -en "\033"
echo -en "\033"
echo -en "\033"
echo -en "y\n"
sleep 1
}
tpipe|telnet $1