*** clogin	Fri Feb 24 17:38:26 2006
--- /home/rancid/bin/clogin	Fri Feb 24 17:16:48 2006
***************
*** 287,297 ****
  
  # Log into the router.
  # returns: 0 on success, 1 on failure, -1 if rsh was used successfully
  proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
      global spawn_id in_proc do_command do_script platform
!     global prompt u_prompt p_prompt e_prompt sshcmd
      set in_proc 1
      set uprompt_seen 0
  
      # try each of the connection methods in $cmethod until one is successful
      set progs [llength $cmethod]
--- 287,297 ----
  
  # Log into the router.
  # returns: 0 on success, 1 on failure, -1 if rsh was used successfully
  proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
      global spawn_id in_proc do_command do_script platform
!     global prompt u_prompt p_prompt e_prompt t_prompt sshcmd
      set in_proc 1
      set uprompt_seen 0
  
      # try each of the connection methods in $cmethod until one is successful
      set progs [llength $cmethod]
***************
*** 524,540 ****
  }
  
  # Enable
  proc do_enable { enauser enapasswd } {
      global prompt in_proc
!     global u_prompt e_prompt
      set in_proc 1
  
      send "enable\r"
      expect {
  	-re "$u_prompt"	{ send "$enauser\r"; exp_continue}
  	-re "$e_prompt"	{ send "$enapasswd\r"; exp_continue}
  	"#"		{ set prompt "#" }
  	"(enable)"	{ set prompt "> (enable) " }
  	-re "(denied|Sorry|Incorrect)"	{
  			  # % Access denied - from local auth and poss. others
  			  send_user "\nError: Check your Enable passwd\n";
--- 524,541 ----
  }
  
  # Enable
  proc do_enable { enauser enapasswd } {
      global prompt in_proc
!     global u_prompt e_prompt t_prompt
      set in_proc 1
  
      send "enable\r"
      expect {
  	-re "$u_prompt"	{ send "$enauser\r"; exp_continue}
  	-re "$e_prompt"	{ send "$enapasswd\r"; exp_continue}
+ 	-re "$t_prompt"	{ send "$enapasswd\r"; exp_continue}
  	"#"		{ set prompt "#" }
  	"(enable)"	{ set prompt "> (enable) " }
  	-re "(denied|Sorry|Incorrect)"	{
  			  # % Access denied - from local auth and poss. others
  			  send_user "\nError: Check your Enable passwd\n";
***************
*** 772,781 ****
--- 773,791 ----
      if { "$e_prompt" == "" } {
  	set e_prompt "\[Pp]assword:"
      } else {
  	set e_prompt [join [lindex $e_prompt 0] ""]
      }
+     #####
+     # 02.23.06 - adding PASSCODE method
+     set t_prompt [find enableprompt $router]
+     if { "$t_prompt" == "" } {
+ 	set t_prompt "\PASSCODE:"
+     } else {
+ 	set t_prompt [join [lindex $t_prompt 0] ""]
+     }
+     #####
  
      # Figure out cypher type
      if {[info exists cypher]} {
          # command line cypher type
          set cyphertype $cypher
