[Xorp-users] configuration

Pavlin Radoslavov pavlin at icir.org
Wed Nov 28 13:53:23 PST 2007


Florin Dinu <fd2 at cs.rice.edu> wrote:

> Hello
> 
> Is it possible to do something like :
> ./xorpsh -c "configure delete interfaces interface eth2" ?
> I want to do this from a java program.
> The option there is to call exec with a string as a parameter so i need 
> to do this in one shot.
> However if I use the command above then xorpsh enters configure mode and 
> then does nothing.It just awaits input.
> Can this be done?

You need to specify each new command separately with another
-c "command". E.g.,

./xorpsh -c "configure" -c "delete interfaces interface eth2" -c "commit"

The alternative would be to have a file with those commands (one
command per new line), and then pipe it into xorpsh:
cat commands.txt | ./xorpsh

For testing purpuse try it first by hand from the command line and
once you get it working then run it inside your Java program.

Regards,
Pavlin



More information about the Xorp-users mailing list