Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SCRIPT]rebond telnet (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Mon Oct 30, 2006 10:05 am    Post subject: [SCRIPT]rebond telnet (résolu) Reply with quote

Bonjour,

je suis en train de faire un script qui va faire un telnet sur un switch (monswitch2 en rebondissant sur un autre switch (monswitch). mon script fonctionne et ressemble à ça
Code:

#!/bin/sh
(while read line;do
echo $line
sleep 1
done <<EOF
login
mdp
telnet monswitch2
login
mdp
EOF
) | telnet monswitch


Tout fonctionne bien, j'arrive à me connecter au second switch, mais une fois le while terminé, le telnet est coupé, or je voudrai que mon terminal reste ouvert sur le telnet monswitch2. Est ce que quelqu'un à une idée ?


Last edited by Bapt on Tue Oct 31, 2006 5:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Tue Oct 31, 2006 4:42 pm    Post subject: Reply with quote

Est-ce que tu as essayé en mettant tes cmds de login/rebond dans un petit fichier (connect_switch2.txt) et en faisant qqch comme ceci:
Code:
#!/bin/sh
cat connnect_switch2.txt - | (while read line ; do echo $line ; sleep 1 ; done ) | telnet monswitch

(Pas testé du tout...)
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Tue Oct 31, 2006 4:59 pm    Post subject: Reply with quote

Non je vais essayé, mais je n'y crois pas trop :)
Back to top
View user's profile Send private message
Bapt
Veteran
Veteran


Joined: 14 Apr 2003
Posts: 1152
Location: Paris

PostPosted: Tue Oct 31, 2006 5:03 pm    Post subject: Reply with quote

Ca marche :) Merci beaucoup :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum