mikrotik script generation error
Posted: 30 Jan 2020, 11:02
hi there,
i get error on the generation of the walledgarden script on the dns part
/ip dns
set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB servers=DNS1,DNS2
:for i from=0 to=([/ip dhcp-server network print count-only]-1) do={/ip dhcp-server network set dns-server= }
/ip hotspot set [find name="our hotspot"] keepalive-timeout=0s
:foreach i in [/ip hotspot profile find] do={
:local loginby [/ip hotspot profile get $i login-by];
:local LoginbyEncoded
:foreach item in=$loginby do={
:if ($item != "https") do={
:set $LoginbyEncoded ($LoginbyEncoded .$item.",");
}
}
/ip hotspot profile set $i login-by=$LoginbyEncoded;
/ip hotspot profile set numbers=$i dns-name=""
}
the script bombs out on this - servers=DNS1,DNS2. they are not defined, or i cant find it anywhere
then if i change the dns values for testing, it ask me this to enter for the amount of hotspots
22
numbers: 0 (i have to type 0)
numbers: 1(i have to type 1)
numbers: 2
numbers: 3
numbers: 4
numbers: 5
numbers: 6
can someone please help me?
regards
chris
i get error on the generation of the walledgarden script on the dns part
/ip dns
set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB servers=DNS1,DNS2
:for i from=0 to=([/ip dhcp-server network print count-only]-1) do={/ip dhcp-server network set dns-server= }
/ip hotspot set [find name="our hotspot"] keepalive-timeout=0s
:foreach i in [/ip hotspot profile find] do={
:local loginby [/ip hotspot profile get $i login-by];
:local LoginbyEncoded
:foreach item in=$loginby do={
:if ($item != "https") do={
:set $LoginbyEncoded ($LoginbyEncoded .$item.",");
}
}
/ip hotspot profile set $i login-by=$LoginbyEncoded;
/ip hotspot profile set numbers=$i dns-name=""
}
the script bombs out on this - servers=DNS1,DNS2. they are not defined, or i cant find it anywhere
then if i change the dns values for testing, it ask me this to enter for the amount of hotspots
22
numbers: 0 (i have to type 0)
numbers: 1(i have to type 1)
numbers: 2
numbers: 3
numbers: 4
numbers: 5
numbers: 6
can someone please help me?
regards
chris