Wednesday, November 20, 2013

Running shell scripts on Junos

You can run a shell script in Junos.

user@R1> start shell
% su
Password:
root@R1% sh tpl.sh 
root@R1% ls
op1.txt tpl.sh
root@R1% more op1.txt 
set interfaces xe-0/0/0 description to-R4-xe-0/3/0
set interfaces xe-0/0/0 unit 0 family inet mtu 1500

root@R1% 
root@R1% more tpl.sh 
#!/sbin/sh

cli -c 'show configuration interfaces | display set' >> op1.txt
root@R1% 
root@R1% exit
exit
% exit

No comments:

Post a Comment