Script for Enable/Disable Interface

Let’s say my ether2 interface’s name is renamed to from ether2 to class_2.
When i use script interface ethernet disable class_2 & i_nterface ethernet enable class_2_, is not working. But if not renamed my interface, it’s working (interface ethernet disable ether2 & i_nterface ethernet enable ether2_). Or if i renamed to ether class2 or ether_class2, it’s working with just script interface ethernet disable ether2 & i_nterface ethernet enable ether2_.

Are for script enable/disable interface, the interfaces must not renamed? or even renamed, it must still have ether2 word?

It’s more practical not to rename interfaces but to use description note instead. But it should not have any influence on using the names in the commands.