1
vote
1answer
425 views

Shell script to perform telnet session to ser2net

I have setup a xenserver (free) hosting a VM (Debian 7.5). On this xenserver I have attached a serial GSM modem. I have configured xen to run ser2net so I have a serial proxy available. This works ...
2
votes
1answer
59 views

Problem on running Script on host after connecting

I am new to linux scripting. Please help. I searched on below a lot but was not able to find appropriate answer : I am trying to make a script which I will later schedule as cronjob, so that it keeps ...
2
votes
1answer
80 views

Multiplex bash function execution

I created a bash function to "automagically" connect on our switches and retrive their startup-config using the expect command. I have to use expect because this switch does not accept the ssh ...
0
votes
2answers
440 views

“Expect” automation tool output to shell variable

#!/bin/bash # more commands here expect << EOD spawn telnet localhost 9151 expect -exact "Trying 127.0.0.1...\r Connected to localhost.\r Escape character is '^]'.\r" send -- "AUTHENTICATE ...
0
votes
3answers
660 views

Script to login to ssh twice

I need to login through ssh twice with a script and can't get it to work. This is what I have in my script file: #!/usr/bin/expect set login "user" set addr "address1" set addr2 "address2" set pw ...
2
votes
1answer
232 views

how to replace IP address on remote host using expect

I wrote the following expect script in order to replace the IP address on remote Linux machine I use a perl one-liner for this task I get errors about can't read "HOME": no such variable , Please ...
4
votes
3answers
4k views

bash script error stty: standard input: Inappropriate ioctl for device

I'm using here-documents in a bash script to automate installation and setup where a password is required many times. I enter the password once and the script passes it to the various commands. In ...
1
vote
1answer
1k views

Run expect script from other shell

My target is to create the /var/tmp/add_user.bash script from /var/tmp/create_script_add_user.bash script and run the expect script (add_user.bash) from create_script_add_user.bash script. The ...
1
vote
1answer
345 views

How to safely put user typed password into a file?

Is there any way to put the password typed by user into a file (either in Unix or in expect). read -s -p "enter password" input echo $input > file Is the above code safe? I want to use that ...
2
votes
1answer
4k views

error handling in expect?

I am just improving my quetion becasue i have acieved so far upto this: set username [lindex $argv 0] set password [lindex $argv 1] set hostname [lindex $argv 2] if {[llength $argv] == 0} { ...
0
votes
1answer
224 views

Is expect tool availabe for ARM platform

I need to get expect (tool for automating interactive applications) for the ARM platform. Is it a readily cross compiled to ARM and is it available? I tried googling but was unable to get the ...
2
votes
1answer
581 views

How to get the PID from a spawned process in expect?

Example: In a shell script I open a SSH tunnel whit this: /usr/bin/expect <<EOD set timeout -1 spawn ssh -fNL localhost:1873:localhost:873 HOST expect "*?assword:" { send "$SSHPASS\r"} sleep 2 ...