[rancid] .cloginrc add method hostname {ssh:-port} for mtlogin/mtrancid?

Lukasz Sokol el.es.cr at gmail.com
Wed Jun 3 16:04:17 UTC 2015


On 03/06/15 16:42, Lukasz Sokol wrote:
> On 03/06/15 16:08, heasley wrote:
>> Wed, Jun 03, 2015 at 03:07:39PM +0100, Lukasz Sokol:
>>> rancid at george:~$ bin/mtlogin hostname
>>> hostname
>>>
>>> Error: unknown connection method: ssh:65122
>>>
>>> will get there, eventually :)
>>
>> grumble.  it needs to match the port below; i think this change is the
>> missing bit.  sorry
>>
>> Index: bin/mtlogin.in
>> ===================================================================
>> --- bin/mtlogin.in	(revision 3124)
>> +++ bin/mtlogin.in	(working copy)
>> @@ -277,7 +277,7 @@
>>  		send_user "\nError: telnet failed: $reason\n"
>>  		return 1
>>  	    }
>> -	} elseif ![string compare $prog "ssh"] {
>> +	} elseif [string match "ssh*" $prog] {
>>  	    # ssh to the router & try to login with or without an identfile.
>>  	    regexp {ssh(:([^[:space:]]+))*} $prog methcmd suffix port
>>  	    set cmd $sshcmd
>>
>>
> I found the relevant line next to the previous backport,
> but this change causes all ssh contacts to fail even the 'up' test.
> 
> what is wrong with compare ?
> 
> lukasz

would this mean that the default ssh method would need to be {ssh:22} with this change? 
so that the one with {ssh:65122} will be an exception ? 

or might the order of 'regexp {...} methcmd suffix port'  matter then?

sorry for stabbing in the dark :)

lukasz



More information about the Rancid-discuss mailing list