Script Management Commands

Use these M4500 CLI commands to apply, delete, list, show, and validate configuration scripts on the switch.

script apply

This command applies the commands in the script to the switch.

Default None
Format script apply <scriptname>
Mode Privilege EXEC

script delete

This command deletes a specified script or all scripts on the switch.

Default None
Format script delete {<scriptname> | all}
Mode Privilege EXEC

script list

This command lists all scripts on the switch as well as the remaining available space.

Default None
Format script list
Mode Privilege EXEC

Example:

CODE
(M4500-32C) #script list

Configuration Script Name        Size(Bytes)
-------------------------------- -----------
1.scr                                   1092
t.scr                                   1092
2 configuration script(s) found.
5117 Kbytes free.
(M4500-32C) #

script show

This command displays the content of a script file.

Default None
Format script show <scriptname>
Mode Privilege EXEC

Example:

CODE
(M4500-32C) #script show test.scr
1 : !Current Configuration:
2 : !
3 : !System Description "M4500-32C, Runtime Code 7.0.0.1"
4 : !System Software Version "7.0.0.1"
5 : !System Up Time          "0 days 0 hrs 1 mins 45 secs"
6 : !Additional Packages     BGP-4,QOS,Multicast,IPv6,Routing,Data Center
7 : !Current System Time: Aug  5 08:22:08 2019
8 : !
9 : configure
10 : hostname "Switch"
11 : serviceport protocol dhcp6
12 : vlan database
13 : exit
14 : time-range
15 : kron policy-list p1
16 : cli show version | redirect tftp://172.20.0.28/kr-t6.txt
17 : exit
18 : username "admin" passwd 7
d32036926a456949a1dd05f3768212c089add94bccd752314f0c05fedf66f52c407256118c62e461710
1230004dff4ee69c4e4d4eaed9590cfd5fe318b39dac3 level 15
19 : username "admin" role "network-admin"
20 : username "guest" role "network-operator"
21 : aaa authentication login "networkList" radius
22 : radius server host auth "172.20.0.107" name "Default-RADIUS-Server"
23 : line console
24 : exec-timeout 0
25 : exit
26 : line vty
27 : exit
28 : line ssh
29 : exit
30 : interface vlan 1
31 : exit
32 : snmp-server sysname "Switch"
33 : !
34 : interface control-plane
35 : exit
36 : application install orig_restful_api
37 : router ospf
38 : exit
39 : ipv6 router ospf
40 : exit
41 : exit
(M4500-32C) #

script validate

This command validates an assigned script by parsing each line. The validate option is intended to be used as a tool for script development.

Default None
Format script validate <scriptname>
Mode Privilege EXEC

Example:

CODE
(M4500-32C) #script validate test.scr

configure
hostname "Switch"
serviceport protocol dhcp6
vlan database
exit
time-range
kron policy-list p1
cli show version | redirect tftp://172.20.0.28/kr-t6.txt
exit
username "admin" passwd 7
d32036926a456949a1dd05f3768212c089add94bccd752314f0c05fedf66f52c407256118c62e461710
1230004dff4ee69c4e4d4eaed9590cfd5fe318b39dac3 level 15
username "admin" role "network-admin"
username "guest" role "network-operator"
aaa authentication login "networkList" radius
radius server host auth "172.20.0.107" name "Default-RADIUS-Server"
line console
exec-timeout 0
exit
line vty
exit
line ssh
exit
interface vlan 1
exit
snmp-server sysname "Switch"
interface control-plane
exit
application install orig_restful_api
router ospf
exit
ipv6 router ospf
exit
exit
Configuration script 'new-script.scr' validated.
(M4500-32C) #