[rancid] Netscreen jlogin

heasley heas at shrubbery.net
Tue Dec 18 21:10:33 UTC 2012


Tue, Dec 18, 2012 at 12:47:03PM -0800, Raymond Eustaquio:
> I am attempting to run this command.
> 
> /home/rancid/bin/flogin -x /usr/bin/isis_foundry_sfo device1  >>
> /var/tmp/sw/device1
> 
> The scripts never exits because the Netscreen awaits a reply for the
> following question:
> 
> FW1.SVX:FW1a.SVX(M)-> exit
> 
> Configuration modified, save? [y]/n 
> 
> How can I send a reply of 'n' or skip the question all together?

ah, new reasons to hate foundry.  try the following flogin patch and lmk
if it works.

Index: flogin.in
===================================================================
--- flogin.in	(revision 2654)
+++ flogin.in	(working copy)
@@ -513,7 +513,7 @@
 
 # Run commands given on the command line.
 proc run_commands { prompt command } {
-    global in_proc
+    global do_saveconfig in_proc
     set in_proc 1
 
     send -h "skip-page-display\r"
@@ -543,6 +543,14 @@
 						  return 0
 						}
 	eof					{ return 0 }
+	-re "Configuration modified, save\? \[\r\n]*" {
+						  if {$do_saveconfig} {
+						    catch {send "y\r"}
+						  } else {
+						    catch {send "n\r"}
+						  }
+						  exp_continue
+						}
     }
     set in_proc 0
 }


More information about the Rancid-discuss mailing list