Open miken32 opened 1 year ago
This issue is happening on both RouterOS versions 6.49 and 7.7 under Rancid 3.13. My mtlogin
is modified, but only to change the login to use the cte200w
username suffix instead of ct200w
.
And this is what the script looks like in the config:
add dont-require-permissions=no name=dns-update owner=admin policy=read,write \
source=":local domains [:toarray \"\"]\
\n:local dnsttl \"90m\"\
\n\
\n:local magiccomment \"automatic-from-dhcp (magic comment)\"\
\n:local activehosts [:toarray \"\"]\
\n\
\n:foreach lease in [/ip dhcp-server lease find] do={\
\n :local hostname [/ip dhcp-server lease get value-name=host-name \$leas\
e]\
\n :local hostaddr [/ip dhcp-server lease get value-name=address \$lease]\
\n\
\n :if ([:len \$hostname] > 0) do={\
\n :foreach domain in \$domains do={\
\n :local regdomain \"\$hostname.\$domain\"\
\n :set activehosts (\$activehosts, \$regdomain)\
\n\
\n :if ([:len [/ip dns static find where name=\$regdomain]] = 0) do={\
\n # add new entry\
\n /ip dns static add name=\$regdomain address=\$hostaddr comment=\
\$magiccomment ttl=\$dnsttl\
\n } else={\
\n :if ([:len [/ip dns static find where name=\$regdomain address=\
\$hostaddr comment=\$magiccomment]] = 0) do={\
\n # update entry only if IP, name, and comment don't match\
\n /ip dns static set address=\$hostaddr [/ip dns static find nam\
e=\$regdomain comment=\$magiccomment]\
\n }\
\n }\
\n }\
\n }\
\n}\
\n\
\n# remove old entries\
\n:foreach dnsentry in [/ip dns static find where comment=\$magiccomment] \
do={\
\n :local hostname [/ip dns static get value-name=name \$dnsentry]\
\n :if ([:type [:find \$activehosts \$hostname]] = \"nil\") do={\
\n /ip dns static remove \$dnsentry\
\n }\
\n}\
\n"
Exports from my device are getting cut off after certain system scripts. It seems to be something to do with the contents of the script; if I install the following script on my router, it and everything in the configuration afterwards is removed:
The debug output is a little overwhelming considering my configuration is 600 lines long and each line seems to generate a half dozen lines of debug. How can I narrow down what the problem might be?