create a my own default configuration to run after reset configuration

Hello ,
I have created a backup file of my router
now - I want it to run after I make reset configuration automatically
but when I run this command

/system reset-configuration run-after-reset=backup.rsc

it just reset the router to default and doesn’t run any thing to the old configuration

why?


Thanks,

Make sure it has no syntax errors. Also try to run it manually and see if there are no problems.

That’s something mikrotik really lack, a Config checker.

Syntax checker is not enough. The script debugger is very necessary also.

I have run the file manually - working just fine
so this is not the problem
and this is the file I’m running - simple

# jan/02/1970 15:43:47 by RouterOS 6.23
# software id = UDIK-66WQ
#
/interface bridge
add mtu=1500 name=bridge1
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n frequency=auto l2mtu=2290 \
    mode=ap-bridge ssid=2.4Ghz wireless-protocol=802.11
set [ find default-name=wlan2 ] l2mtu=2290 mode=ap-bridge ssid=5Ghz \
    wireless-protocol=802.11
/ip neighbor discovery
set ether1 discover=no
set ether2 discover=no
set ether3 discover=no
set wlan1 discover=no
set wlan2 discover=no
set bridge1 discover=no
/ip pool
add name=dhcp_pool1 ranges=10.0.0.100-10.0.0.130
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=bridge1 lease-time=3h name=\
    dhcp1
/user group
add name=user policy="local,ssh,ftp,reboot,read,write,test,password,web,sensit\
    ive,!telnet,!policy,!winbox,!sniff,!api" skin=user1
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=wlan2
/ip address
add address=10.0.0.1/24 interface=bridge1 network=10.0.0.0
/ip dhcp-server network
add address=10.0.0.0/24 dns-server=8.8.4.4 gateway=10.0.0.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set api disabled=yes
set winbox port=8299
set api-ssl disabled=yes
/system identity
set name=MultiRadioBaseStation
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
/tool mac-server ping
set enabled=no

The order things run in the script may be important, especially when creating interfaces that others depend on. Also, you appear to have a naming issue … notice here:

set [ find default-name=wlan1 ] blah, blah
set [ find default-name=wlan2 ] blah, blah

Those are probably not the default names after /system reset-configuration.

I have check - and yes they are the names
if I make al the setup manually - it does work
“reset configuration–> /import file=test.rsc” , it upload the file and work just fine

what else could it be ?

Thanks,

Add delay at the beginning. Or loop to delay until wireless interfaces are loaded.

Also worth adding no-defaults=yes and skip-backup=yes to the reset command.
This will prevent the router from building the default setup (like the 88.1 IP address etc.)