Input two password(pass1/pass2) options for single node..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Input two password(pass1/pass2) options for single node..
# 1  
Old 03-05-2015
Input two password(pass1/pass2) options for single node..

Hi Team,
i want to input two password for single node like pass1/pass2 one of the pass1 is working some node and pass2 is working for some nodes .
For nodes having pass1 i have to run diffrent script and
for nodess having pass2 i have to run diffrent script

Sooo
how can put two pass (Pass1/pass2)option in single script..

I m using.

1st script is like........
Code:
#!/usr/bin/expect
spawn telnet $ip
expect "login:"
send "USR\r"
expect "*assword*"
send "pass1\r"
expect "*$"


2nd script is like........
Code:
#!/usr/bin/expect
spawn telnet $ip
expect "login:"
send "USR\r"
expect "*assword*"
send "pass1\r"
expect "*$"


i want both pass1&pass2 option in single script , how can i do it????

---------- Post updated at 02:51 AM ---------- Previous update was at 02:04 AM ----------

Can any one help me??

Last edited by vbe; 03-05-2015 at 06:29 AM.. Reason: code tags please not icode...
# 2  
Old 03-05-2015
Using expect to get past a login process is usually a bad idea for several reasons, however rather than bang on about them, have you considered either setting up rlogin permission or better still generating ssh-keys and using ssh to automate the submitting of work to the other server?



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Mount FIle systems from node-1 onto node-2

Hi, We have HP UX service guard cluster on OS 11.23. Recently 40+ LUNs presented to both nodes by SAN team but I was asked to mount them on only one node. I created required VGs/LVs, created VxFS and mounted all of them and they are working fine. Now client requested those FS on 2nd node as... (4 Replies)
Discussion started by: prvnrk
4 Replies

2. Shell Programming and Scripting

How do I split a single-line input into five lines?

Example input: John:Shepherd:770-767-4040:U.S.A:New York Mo Jo:Jo Jo: 666-666-6666:U.S.A:Townsville Expected Output: First Name: John Last Name: Shepherd Phone Number: 770-767-4040 Country: U.S.A State: New York First Name: Mo Jo Last Name: Jo Jo Phone Number: 666-666-6666... (10 Replies)
Discussion started by: Camrikron
10 Replies

3. Homework & Coursework Questions

Accessing one UNIX node from another node of the same server

Hi Experts, I am in need of running a script from one node say node 1 via node 2. My scheduling tool dont have access to node2 , so i need to invoke the list file from node1 but the script needs to run from node2. because the server to which i am hitting, is having access only for the node... (5 Replies)
Discussion started by: arun1377
5 Replies

4. Shell Programming and Scripting

How to make sure the input string is one of many options?

How to make sure the input string is one of many options e.g centos-5.5-i386 windows-2003r2-x64 ? The options are dynamic, so "case" condition check doesn't work. I use grep -o -w , it doesn't work every time because - is valid word boundry #word windows-2003 failed the check as expected... (4 Replies)
Discussion started by: honglus
4 Replies

5. Shell Programming and Scripting

Input two variable on single line

Can we input two variable on single line that separate by space example user input "list jpg" it will list all jpg files in current directory (3 Replies)
Discussion started by: guidely
3 Replies

6. Solaris

Solaris Single Sign on options

We are looking for implementing solaris single sign on with AD in our environment which as few hundred Solaris hosts and couple of hundred solaris zones ..IS there any third party software for the same or we can do it by just making the solaris servers as AD clients ? Any help is appreciated. (1 Reply)
Discussion started by: fugitive
1 Replies

7. Solaris

Single node Sun Cluster with zones

How can we add a shared zfs dataset between 2 zones on a same host. I have sun cluster 3.2 installed in a server which has 2 zones. I want to share a zfs data set between these 2 zones how can we do that ? (7 Replies)
Discussion started by: fugitive
7 Replies

8. Solaris

How to remove single node cluster

Hi Gurus, I am very new to clustering and for test i have created a single node cluster, now i want to remove the system from cluster. Did some googling however as a newbee in cluster unable to co related the info. Please help Thanks (1 Reply)
Discussion started by: kumarmani
1 Replies

9. Solaris

How to configure zones into Single node cluster

Hi Gurus, For learning purpose, I have installed a single node cluster 3.2 on Solaris 10 for practice. Now I am welling to create two non-global zone and create them as a fail over. Will appreciate your help and assistance. Thanks (3 Replies)
Discussion started by: newadmin
3 Replies

10. Shell Programming and Scripting

single input shell script?

hey, i'm trying to write a shell script which accepts: operand operator operand then, the script would see which operator it is (using case) and calculate it... but i dont know how to do it correctly with $1 $2 $3... (eliminating accepting separate inputs) (1 Reply)
Discussion started by: quipy
1 Replies
Login or Register to Ask a Question