Update of /cvsroot/sandweb/sandweb/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv16366/bin
Modified Files:
sandweb-expect
Log Message:
* can now handle accepting hostkey
* reports login errors correctly
caveat - it times out after 10 seconds for the initial password attempt,
and expects the hostkey question instead.
there _must_ be a way to do "expect this or that" in expect, instead
of the "expect this until timeout, expect this until timeout". I'll
keep looking.
Index: sandweb-expect
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb-expect,v
retrieving revision 1.10
retrieving revision 1.11
diff -U2 -r1.10 -r1.11
--- sandweb-expect 7 Nov 2002 08:01:10 -0000 1.10
+++ sandweb-expect 23 Jan 2003 08:16:49 -0000 1.11
@@ -18,24 +18,24 @@
spawn /bin/sh -c $vcs_command
+ set timeout 10
expect {
"password:" { send "$vcs_password\r" }
+ "denied" { exit 2 }
+ eof { exit 0 }
+
}
expect {
+ "Are you sure" { send "yes\r" }
+ "password:" { send "$vcs_password\r" }
+ "denied" { exit 2 }
+ eof { exit 0 }
+ }
- "Are you sure" {
- send "y"
- }
-
- "denied" {
- send "Invalid VCS username/password\r"
- exit 2
- }
-
- eof {
- # success
- exit 0
- }
+ expect {
+ "password:" { send "$vcs_password\r" }
+ "denied" { exit 2 }
+ eof { exit 0 }
}
|