First of all, code is easier to read when it is in a code block. I think your code is:
:if ([/system resource get board-name] = "RB750GL" ) do={ :do { certificate import file-name=AddTrustExternalCARoot.CRT passphrase="" }\
on-error={ certificate import file-name=AddTrustExternalCARoot.crt passphrase=""} } else={ :do { certificate import file-name=flash/AddTrustExternalCARoot.CRT passphrase="" }\
on-error={ certificate import file-name=flash/AddTrustExternalCARoot.crt passphrase="" } }
or, with better line breaks (I don't think any of the backslashes are required in this version):
:if ([/system resource get board-name] = "RB750GL" ) do={
:do {
certificate import file-name=AddTrustExternalCARoot.CRT passphrase=""
} on-error={
certificate import file-name=AddTrustExternalCARoot.crt passphrase=""
}
} else={
:do {
certificate import file-name=flash/AddTrustExternalCARoot.CRT passphrase=""
} on-error={
certificate import file-name=flash/AddTrustExternalCARoot.crt passphrase=""
}
}
I'm far from an expert, but the items I see that might be problems are:
- certificate instead of /certificate. certificate by itself will only work if you are in the root. You use /system, so I suspect you aren't at the root.
- Startup scripts typically require a delay. 15 seconds seems to be the standard.
# wait 15 seconds
:delay 15
Note: I've never done anything with certificates, but do they really need to be reinstalled on each startup? And if the file name is case-sensitive, shouldn't you just select one case and use that consistently? It should be possible to find the file (regardless of case or subdirectory), store the filename in a local variable, and then only have one certificate import command.
P.S. You helped me too--I was looking for something like [/system resource get board-name].