Analyze your ‘users’ export script file, first three lines probably looks like this:
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m name=default shared-users=unlimited status-autorefresh=1m transparent-proxy=no
add idle-timeout=none keepalive-timeout=2m name=trial shared-users=20 status-autorefresh=1m transparent-proxy=noThis code tries to add ‘trial’ user profile, but this profile already exists, hence error message:
user profile with such name already exists
Remove these line from .rsc file before importing.
HTH,
edit: in sentence ‘This code tries to add ‘trial’ user profile…’ was ‘default’ instead of ‘trial’
The one that gets the error is the second one (I added them on a terminal window).
The thing is, the first time it imports ok, but then i wanna import it again for the new ones added (users) and then it gets me the error.
The idea is to replicate the users created on Router A to Router B with scripts and scheduler… I don’t want to do it file by file I want it to be automatic.
/ip hotspot user profile>
remove [find name=your_profile_name]This code will remove profile named ‘your_profile_name’,
but remember ‘default’ profile can not be removed, so don’t use it.
So there’s no way to delete them all except default?
Or a way to import configurations overwriting the old ones?
EDIT: I’ve find this command that lets met erase all users at once:
/ip hotspot user remove [/ip hotspot user find]
So i could be running that on a script followed by the one importing all of them again and that would make the effect of “updating” them.
On the other hand i’ve tried this:
/ip hotspot user profile remove [/ip hotspot user profile find]
It doesnt work 'cause i can’t erase the default one… So, how can I modify the second command to just let me erase everything besides the default one?
EDIT N°2: So.. i think i’ve got it…
This is the script i’ve come up with:
/ip hotspot user remove [/ip hotspot user find]
/ip hotspot user profile remove [/ip hotspot user profile find name !=default]
/ip hotspot ip-binding remove [/ip hotspot ip-binding find]
/import users.rsc
/import bindings.rsc
This along side with some scheduling allows me to replicate hotspot users, profiles and bindings in all the routers that I have in operation just modificating the “master” one. It’s really weird that an overwrite option for import is not there, it would be very useful.
Anyways, I hope this is useful for someone. Thanks for the replies.