My auto.rcs stops after the 'IF' check happens. The 'IF' appears to work correctly as the account gets created if it doesn't exist and the password is set if the account already exists.
This is the tail end of the auto.rsc that I have the router load after a system reset:
Code: Select all
...
# Check if user rancid exists, create if it doesn't.
:if ( [/user find where name=rancid] ) do={
:log info ("User rancid already exists, skipping creation. Setting password")
:put [ /user set [ find name=rancid ] password=rancid-passwd ]
} else ={
:log info ("Creating user: rancid")
:put [ /user add address=10.0.0.0/24 comment="Local auth Rancid user." group=read name=rancid password=rancid-passwd ]
}
/user set [ find name=admin ] password=admin-passwd
/certificate add name=self-signed-certificate common-name=switch02\
country=US days-valid=3650 key-size=4096 locality=NorthAmerica organization="USA."\
state=USA trusted=yes unit="Engineering" key-usage=digital-signature,key-cert-sign,crl-sign
/certificate sign acs-self-signed-certificate
/ip service set www-ssl certificate=acs-self-signed-certificate
Can I not use scripting inside the auto.rcs?
Is there something that I need to do to tell the auto.rcs to continue running after the 'IF' check happens?
Thanks.