Community discussions

MikroTik App
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

help mrz

Mon Aug 10, 2009 7:56 pm

hi mrz any script to migrate hotspot users to userman users
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: help mrz

Wed Aug 12, 2009 11:10 am

you could write a script to parse hotspot users and run the command to import users into userman. It should be fairly trivial.
Doug
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

Re: help mrz

Thu Aug 13, 2009 5:53 am

how?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6043
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: help mrz

Thu Aug 13, 2009 9:37 am

it's easy, for example get username and password and create user in usermanager
:foreach i in=[/ip hotspot user find] do={
   :local user [/ip hotspot user get $i name];
   :local pass [/ip hotspot user get $i password];
   /tool user-manager user add name=$user password=$pass subscriber=admin
}
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

Re: help mrz

Fri Aug 14, 2009 7:31 pm

thanks and what about for mac address and ip
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: help mrz

Fri Aug 14, 2009 7:45 pm

:foreach i in=[/ip hotspot user find] do={
   :local user [/ip hotspot user get $i name];
   :local pass [/ip hotspot user get $i password];
   :local ip [/ip hotspot user get $i address];
   /tool user-manager user add name=$user password=$pass ip-address=$ip subscriber=admin
}
user-manager doesn't have a field for MAC addresses.

Hope that helps,
Felix
Specific answers require specific questions. When in doubt, post the output of "/ip address print detail", "/ip route print detail", "/interface print detail", "/ip firewall export", and an accurate network diagram.
 
adilazzubaidi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Tue Dec 04, 2007 8:13 am

Re: help mrz

Fri Aug 14, 2009 8:51 pm

userman v4b4 contains caller ID (mac address)
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: help mrz

Fri Aug 14, 2009 9:09 pm

Then add
:local mac [/ip hotspot user get $i mac-address];
and change the insert
/tool user-manager user add name=$user password=$pass ip-address=$ip whatever-property-holds-the-mac-address=$mac subscriber=admin
Specific answers require specific questions. When in doubt, post the output of "/ip address print detail", "/ip route print detail", "/interface print detail", "/ip firewall export", and an accurate network diagram.
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: help mrz

Sat Aug 15, 2009 12:13 am

Then add
/tool user-manager user add name=$user password=$pass ip-address=$ip whatever-property-holds-the-mac-address=$mac subscriber=admin
/tool user-manager user add name=$user password=$pass ip-address=$ip caller-id=$mac subscriber=admin
The caller-id field also works when tested on 3.25 - 3.28.
Doug

Who is online

Users browsing this forum: Google [Bot], harvey and 18 guests