Sponsored Content
Top Forums Shell Programming and Scripting Expect script to automate telnet session Post 302452636 by abxccd on Sunday 12th of September 2010 04:57:20 AM
Old 09-12-2010
Thank you again for your reply! I think I am almost getting there.

I modified your code as follows:

Code:
 
#!/usr/bin/expect
log_user 0
spawn telnet localhost 7777
expect "mip6d>" { 
log_user 1
send "pl\r"}
expect "mip6d>" {
log_user 0
send "exit\r" }
interact

I now get this output:

Code:
pl
eth2 2001:a:b:2:3:4:5:10/64
  valid 86400 / 86400 preferred
mip6d> exit
Connection closed by foreign host.

I can't find a way to get the inputted commands and the final exit message to go away. Do you know what's wrong?

Thank you Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

closing a telnet session on error, in a shell script

I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed. I want to be able to close the session and complete the script execution in... (1 Reply)
Discussion started by: farahzaiba
1 Replies

2. Shell Programming and Scripting

Telnet Expect script question

Hi all, I have written a small expect script which should spawn a telnet session login and execute some commands. #!/usr/bin/expect -f spawn telnet $env(IP) match_max 100000 expect "login:" send -- "******\n" expect -exact "Password:" send -- "****\n" expect "%" Now I have got... (2 Replies)
Discussion started by: stinkefisch
2 Replies

3. Shell Programming and Scripting

How to automate sftp without using expect script?

How to automate sftp with out using expect script? My batch file has the password but it is not taking. Please see below. I want to use this sftp connection in a loop for pushing new files in a directory one at a time. Hence I can not use an expect script. bash-2.05$... (5 Replies)
Discussion started by: Tuxidow
5 Replies

4. Shell Programming and Scripting

Expect Script to Automate SSH

How would I write an expect script to automate ssh and what file extention do expect files use? (11 Replies)
Discussion started by: Prodiga1
11 Replies

5. Shell Programming and Scripting

Unable to close telnet session from script

Hello people, I am creating a script that will alert me in an ftp or telnet account on my system expires. FTP part is ok, but when I am entering the 3 script, it stucks. I can see that the script will not close the telnet seession. Can you please check and let me know what I am doing wrong? What if... (7 Replies)
Discussion started by: drbiloukos
7 Replies

6. Shell Programming and Scripting

EXPECT script for Telnet automation. Need your support.

Dear experts, please help me . I've found simple EXPECT scripts and all works fine. But I need more automation in error handling and sending list of commands/output logging from multiple remote hosts. I have 10 hosts, for example: host1 192.168.1.1 LOGIN1 PASSWORD1 ...... ... (2 Replies)
Discussion started by: starchen
2 Replies

7. Shell Programming and Scripting

Calling Expect Script - Telnet

Hi All, I have an Expect script which logs into Cisco switch, performs a show interface command. I want to read a file of ip addresses which will be passed to the expect script. The script to read the file works, the expect script works on it's own but when i call the 'expect' script from the... (12 Replies)
Discussion started by: trinak96
12 Replies

8. Shell Programming and Scripting

expect telnet script execute by cronjob

hi, please help, keep getting this bolded error and look it up and people say its your environment variable though i tried to set it manually in expect..it run fine if i run it manually but once i run it by cronjob it error below..i tried to comment out ip/login info with *.. logfile:: START... (0 Replies)
Discussion started by: cssanangeles
0 Replies

9. Shell Programming and Scripting

How to break out of hung or waiting telnet session in shell script?

I have to put together telnet instructions for 100s of hosts for verifying basic connectivity and get output in a neat format. Problem- If a telnet is hung with message "Trying .... <hostname" due to firewall or routing issue the commands waits for a very long time before it times out and my... (2 Replies)
Discussion started by: desiphantom
2 Replies
mip6d(1)						    Mobile IPv6 and NEMO Daemon 						  mip6d(1)

NAME
mip6d - UMIP Mobile IPv6 and NEMO Basic Support protocol implementation SYNOPSIS
mip6d [options] DESCRIPTION
Mobile IPv6 and NEMO Basic Support implementation OPTIONS
-V, --version Display version information and copyright -?, -h, --help Display this help text -c <file> Read configuration from <file>. If option is not present, default path (/etc/mip6d.conf) is used. These options override values read from config file: -d <number> Set debug level (0-10) -C, --correspondent-node Node is CN -H, --home-agent Node is HA -M, --mobile-node Node is MN SIGNALS
The following signals can be sent to the daemon: SIGHUP Reload the configuration. See mip6d.conf(5) for information on supported option reload. SIGINT, SIGTERM Terminates the daemon operation. FILES
/etc/mip6d.conf SEE ALSO
mip6d.conf(5), mipv6(7), RFC6275: Mobility Support in IPv6 RFC3776: Using IPsec to Protect Mobile IPv6 Signaling Between Mobile Nodes and Home Agents RFC4877: Mobile IPv6 Operation with IKEv2 and the Revised IPsec Architecture RFC3963: Network Mobility (NEMO) Basic Support Protocol May 16, 2005 mip6d(1)
All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy