Hi
Is there a reason you want to use scripts? You can allow the router/switch to automatically download a config from an available tftp server on your network...
By default, if a router/switch does not have any config on NVRAM, it will place all interfaces into vlan one and broadcast for an IP address, once recieved it will search for a tftp server and attempt to download a config file of the same name as its hostname (which it recieved via DHCP)
You can get full details by having a look through this document...
http://www.cisco.com/en/US/docs/switches/lan/catalyst3560/software/release/12.2_40_se/configuration/guide/swipaddr.html
You may find it a better option as it means one local copy of the config on your tftp server and if you ever want to make changes to the config on the router itself, just amend the copy on the tftp server, write erase the router and reload it! it will then download the new config from the tftp server
Please rate if this helps
Urfan