[rancid] Re: lrancid / llogin

Mr. James W. Laferriere babydr at baby-dragons.com
Thu May 6 03:32:21 UTC 2010


 	Hello Diago ,

 	Right in line with the other users I had difficutlies ssh'ng to one of 
my systems ,  it's a Slackware Distro. & I noticed a few things .

 	The "$prompt" had (imo) extra chars in it that prevented the script from 
completing see attached & inline patch .  Maybe someone can clean it up a tad 
more to make it submittable .

 	Hope this helps others .  JimL


# llogin -noenable dsb-esx01
dsb-esx01
spawn ssh -c des -x -l root dsb-esx01
No valid ciphers for protocol version 2 given, using defaults.
The authenticity of host 'dsb-esx01 (10.1.1.102)' can't be established.
RSA key fingerprint is 3c:b8:0f:f5:51:7b:36:b8:0f:3e:de:66:75:a9:22:7b.
Are you sure you want to continue connecting (yes/no)?
Host dsb-esx01 added to the list of known hosts.
yes
Warning: Permanently added 'dsb-esx01' (RSA) to the list of known hosts.
root at dsb-esx01's pssword:
Last login: Thu Apr  1 08:50:40 2010 from mo-it07.dsb.local
[root at dsb-esx01 root]# dir

Error: TIMEOUT reached


-- 
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network&System Engineer | 3237     Holden Road |  Give me Linux  |
| babydr at baby-dragons.com | Fairbanks, AK. 99709 |   only  on  AXP |
+------------------------------------------------------------------+

--- llogin-ORIG 2010-05-05 10:31:59.000000000 -0800
+++ llogin      2010-05-05 11:45:14.000000000 -0800
@@ -714,7 +714,7 @@
         # if it is not a "MetaCommand", passes the command "as is" to
         # the console
         # send_user "[subst [lindex $commands $i]]\n"
-       switch -glob -nocase [subst -nocommands [lindex $commands $i]] {
+       switch -glob [subst -nocommands [lindex $commands $i]] {
          backupfiles {
            set files [find backupfile $host]
             if { [info exists files] && [llength $files] > 0 } {
@@ -752,9 +752,12 @@
      log_user 1

      send -- "exit\r"
+###                                              return 0
      expect {
         -re "\b+"       { exp_continue }
-       -re "Connection to .* closed" { return 0}
+       -re "Connection to .* closed"           {
+                                                 exp_continue;
+                                               }
         -re "^\[^\n\r *]*$reprompt"             {
                                                   # the Cisco CE and Jnx
ERX
                                                   # return to
non-enabled mode
@@ -798,17 +801,17 @@
      if $avautoenable {
         set autoenable 1
         set enable 0
-       set prompt ":~# "
+       set prompt "# "
      } else {
         set ae [find autoenable $router]
         if { "$ae" == "1" } {
             set autoenable 1
             set enable 0
-           set prompt ":~# "
+           set prompt "# "
         } else {
             set autoenable 0
             set enable $avenable
-           set prompt ":~> "
+           set prompt "> "
         }
      }
-------------- next part --------------
# diff -u llogin-ORIG llogin
--- llogin-ORIG 2010-05-05 10:31:59.000000000 -0800
+++ llogin      2010-05-05 11:45:14.000000000 -0800
@@ -714,7 +714,7 @@
        # if it is not a "MetaCommand", passes the command "as is" to
        # the console
        # send_user "[subst [lindex $commands $i]]\n"
-       switch -glob -nocase [subst -nocommands [lindex $commands $i]] {
+       switch -glob [subst -nocommands [lindex $commands $i]] {
         backupfiles {
           set files [find backupfile $host]
            if { [info exists files] && [llength $files] > 0 } {
@@ -752,9 +752,12 @@
     log_user 1

     send -- "exit\r"
+###                                              return 0
     expect {
        -re "\b+"       { exp_continue }
-       -re "Connection to .* closed" { return 0}
+       -re "Connection to .* closed"           {
+                                                 exp_continue;
+                                               }
        -re "^\[^\n\r *]*$reprompt"             {
                                                  # the Cisco CE and Jnx ERX
                                                  # return to non-enabled mode
@@ -798,17 +801,17 @@
     if $avautoenable {
        set autoenable 1
        set enable 0
-       set prompt ":~# "
+       set prompt "# "
     } else {
        set ae [find autoenable $router]
        if { "$ae" == "1" } {
            set autoenable 1
            set enable 0
-           set prompt ":~# "
+           set prompt "# "
        } else {
            set autoenable 0
            set enable $avenable
-           set prompt ":~> "
+           set prompt "> "
        }
     }



More information about the Rancid-discuss mailing list