[quagga-users 11238] Re: non interactive vtysh

Jørgen Sander-Larsen jsl at fuzion.dk
Tue Dec 8 14:30:47 GMT 2009


Hi Vlad

You can use multiple -c arguments:

vtysh -c "sh run" -c "sh int"

but I don't know if the router will stay in "conf t" mode between the commands. I'll leave that to You to find out :-)

Best,
Jorgen Sander-Larsen

-----Oprindelig meddelelse-----
Fra: quagga-users-bounces at lists.quagga.net [mailto:quagga-users-bounces at lists.quagga.net] På vegne af vlad_goreletsky at lexpr.ru
Sendt: 8. december 2009 14:59
Til: quagga-users at lists.quagga.net
Emne: [quagga-users 11237] non interactive vtysh

Hello

"Can anybody find me sombody to..."

Please, help with vtysh.

Some tasks need to execute commands in command mode, something like [vtysh
-c "command string"].

If I execute commands in interactive mode, I have no problems.

For example:

#vtysh
zebra# configure terminal
zebra(config)# interface eth2
zebra(config -if)# ip address 10.3.3.98/24
exit,exit

zebra# show interface eth2
...

But if I collect all of these commands in -c mode, like this:

# vtysh -c "configure terminal interface eth2 ip address 10.3.3.98/24"

command returns 

"%Unknown command"

message.

Where is a mistake?

Something like  

# vtysh -c "show interface eth2" 

works correctly.


OS - CentOS 5.3
package - quagga 0.98.6 - 5.el5

vtysh.conf contains "user root nopassword"


Thanks

Vlad Goreletsky,
newbie

_______________________________________________
Quagga-users mailing list
Quagga-users at lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-users

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.426 / Virus Database: 270.14.96/2549 - Release Date: 12/07/09 19:34:00


More information about the Quagga-users mailing list