Adding routes by script

I am using a script to add new static routes based on DNS entries.

The problem I am having is that the script keeps adding multiple copies of the same routes. Is there a way to prevent it from adding a route if it already exists?

Obviously.
If is a script,
before add routem check first if route already exist.
Simply.

Ok, my scripting skills are limited, but here is my solution if anyone else can improve it or need to use it:

the $myData variable holds the ip in question

:if ([/ip route find dst-address="$myData/32"] != "") do {:log info "Route $myData exists, skipping."} else {
/ip route add dst-address=$myData gateway=xxxx comment=AutoStatic;
:log info ("added entry Route $myData");