Automating telnet

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
    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

DocumentationForm edit

Title How to automate Telnet
Description This page shows a script that automates some configuration taks in Telnet
Tags telnet automate
Category Admin
Topic revision: r4 - 10 Feb 2012, ArthurVarkentin
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback