help with scripting

Hi

Might not actually be the right place but

I keep a rsc file for 2 CCR’s that have the same firewall rules

simple like
/ip firewall filter
remove [ find ]

YB IN

add action=jump chain=YBIN comment=“Check YB SRC” jump-target=YBSRC
add chain=YBIN comment=“Allow SSH” dst-port=22 protocol=tcp
add chain=YBIN comment=OSPF protocol=ospf
add chain=YBIN comment=NTP dst-port=123 protocol=udp src-port=123


Now I find I have need to have specific rules for each router, for natting. is there some what to include some sort if statement where I can go

if hostname = rtr1 then include this line

You should be able to…

:local systemIdentity [/system identity get name]

:if ($systemIdentity = "Identity1") do={
....

....
}

:if ($systemIdentity = "Identity2") do={
....

....
}

As efaden said.
Or you can do it by serial-number, if your router name is dynamic or something.

:if ([/system routerboard get serial-number] = "????????????") do={
    add ...
}

Well, you can control it in any way you want really. You can even check for specific IP addresses if you want.