maybe someone can help me.
Router: MikroTik hex
OS: v6.48
I´ve created a script 'Test' unter /system Scripts as shown below.
On execution i get the following error message:
[admin@ROUTER] > system script run Test
expected command name (line 4 column 24)
Code: Select all
:local piholeDNS "10.0.0.1"
:local testDomain "www.google.com"
:if ([/ip firewall nat [find comment="DNS - Redirect all DNS requests to pihole"] enabled]) do={
:do {
:resolve $testDomain server $piholeDNS
} on-error={
/ip firewall nat disable [find comment="DNS - Redirect all DNS requests to pihole"]
/ip firewall nat disable [find comment="DNS - Traffic from pihole to www"]
}
} else={
:do {
:resolve $testDomain server $piholeDNS
/ip firewall nat enable [find comment="DNS - Redirect all DNS requests to pihole"]
/ip firewall nat enable [find comment="DNS - Traffic from pihole to www"]
} on-error={}
}
I cannot fint the problem, maybe i´m missing something and someone can help me.
Thank you.