script to remove route

Hi,

I have been able to make a script to add a static route statement, but I can’t figure out how to remove it with a script.

/ip route
add disabled=no distance=1 dst-address=207.xx.xxx.xx/32 gateway=“ether3-Beauty Trango” scope=30 target-scope=10

there is no name, so I can’t find it by name. How do I make a script to remove this.

Thanks.
Glenn Allen

You can add comment to that route and remove by comment
/ip route remove [find comment=“myRoute”]

or remove by dst-address
/ip route remove [find dst-address=“207.xx.xxx.xx/32”]

Thanks mrz,

I had tried something like that but it didn’t work, because I capitalized “DST-ADDRESS” since it was all capitalized when I go to /ip route and do a print the headers are all capitalized. I should have looked at when I do an export instead. I am just trying to learn how to do some of these scripts.

Thanks.
ke6hpz