لینک زیر از صفحه میکروتیک شامل اسکریپتی هست که یوزر ها از فایل txt. میخونه و داخل ppp secret/ وارد می کنه.
کد:
http://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Parse_file_to_add_ppp_secrets
با کمی تغییر میشه از فایل csv. بخونه و بجای secret داخل usermanager بسازه:
کد:
:global content [/file get [/file find name=test.csv] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line "";
:global lastEnd 0;
:do {
:set lineEnd [:find $content "\r\n" $lastEnd ] ;
:set line [:pick $content $lastEnd $lineEnd] ;
:set lastEnd ( $lineEnd + 2 ) ;
:local tmpArray [:toarray $line] ;
:if ( [:pick $tmpArray 0] != "" ) do={
:put $tmpArray;
/tool user-manager user add customer=admin name=[:pick $tmpArray 0] username=[:pick $tmpArray 0] password=[:pick $tmpArray 1];
}
} while ($lineEnd < $contentLen)