I’m not too much into scripting, but have a tip: look at the default config script to see how things are done on the CRS, it may contain useful commands for you by comparing them to your scripts.
I didn’t mean to use the default configuration script, but to actually look at how it manages interfaces on the CRS and extrapolate that to cover your needs.