> 
> Sorry, I forgot to mention the crucial detail: It has to be available
> to
> a script. Unfortunately that command does not seem to have a junoscript
> equivalent; "display commit-scripts view" does have a junoscript
> equivalent but does not do what I need.
> 

Junos 12.1 added new options for the <get-configuration> commit-scripts 
attribute, apply and apply-no-transients, that allow you to retrieve the 
post-commit-script configuration, and prior to Junos 12.1 you could always do 
something like <command> "show configuration | display xml | display 
commit-scripts" (be aware that the returned XML structure will be different 
than <get-configuration>), however, these work by running the configuration 
through the commit scripts again, so if you try to call them from a commit 
script you're liable to get a loop.

Why not just have your commit script automatically add the unit number to the 
apply-macros. i.e. if the unit number is already present in the macro then use 
it for the logical interface, but if it is missing then figure out the first 
unused number, use it for the interface, and record it in the macro.


_______________________________________________
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

Reply via email to