用户管理器卡仅从终端脚本生成号码
如何使用阿拉伯语制作视频:
https://www.youtube.com/watch?v=zYaByL0HlPY
如何使用英语视频:
https://www.youtube.com/watch?v=a2aA1TAt_4Y
脚本:
代码:选择所有
#call $gencard from terminal to run ##dev: tiftok.com khaled almalsi https://www.youtube.com/c/TIFTOK ## this script is free 100%:global read do={:return}:global profilelist ({});:全局客户列表({});:全局卡号0;:全局maxcardnumber 200;:global profilereadlist do={if ([:len $profilelist]=0) do={:本地counter1 0;:foreach proi in [/tool user-manager profile find] do={:set ($profilelist->$counter1) ([/tool user-manager profile get $proi name]);:设置$counter1 ($counter1+1);}}}:全局customerreadlist do={if ([:len $ customlist]=0) do={:本地counter1 0;:foreach proi in [/tool user-manager customer find] do={:set ($ customlist ->$counter1) ([/tool user-manager customer get $proi login]);:设置$counter1 ($counter1+1); } } } :global printprofilelist do={ :put ("-please select the profile name :"); :foreach pnum,pname in $profilelist do={ :put ($pnum."-".$pname); } } :global printcustomerlist do={ :put ("-please select the card onwer :"); :foreach pnum,pname in $custmerlist do={ :put ($pnum."-".$pname); } } :global chartonum do={ :local cahrarray {0=0;1=1;2=2;3=3;4=4;5=5;6=6;7=7;8=8;9=9;a=1;b=2;c=3;d=4;e=5;f=6;g=7;h=8;i=9;j=10;k=11;l=12;m=13;n=14;o=15;p=16;q=17;r=18;s=19;t=20;u=21;v=22;w=23;x=24;y=25;z=26} :local output ""; :for i from=0 to=([:len $mystring] - 1) do={ :local char [:pick $mystring $i] ; :set $char ($cahrarray->$char) :set $output ($output . $char) } :return $output ; } :global gencardname do={ :local cardn [pick ([/certificate scep-server otp generate minutes-valid=1 as-value]->"password") 0 8]; :set cardn ([$chartonum mystring=$cardn]) ; :local passwords [pick ([/certificate scep-server otp generate minutes-valid=1 as-value]->"password") 0 4]; :set passwords ([$chartonum mystring=$passwords]) ; :local temparray {"un"=$cardn;"pw"=$passwords}; :return $temparray; } :global gencard do={ $profilereadlist ; $custmerreadlist; :put ("---------wellcome in card generate-------"); $printprofilelist ; local errors ""; local myselectp 0; :do { :put ($errors); :set myselectp [$read]; :set $errors ("the select profile not valid "); } while=(($myselectp > ([:len $profilelist]-1)) || ($myselectp < 0)); local errors ""; local myselectc 0; $printcustomerlist ; :do { :put ($errors); :set myselectc [$read]; :set $errors ("the customer select not valid "); } while=(($myselectc > ([:len $profilelist]-1)) || ($myselectc < 0)); :put ("-please input card count to generate less than ".$maxcardnumber); local errors ""; :do { :put ($errors); :set cardnumber [$read]; :set $errors ("the card count not valid "); } while=($cardnumber > $maxcardnumber); :local script2write ( "\$cardmake cu="."\"".($custmerlist->$myselectc)."\""." pr="."\"".($profilelist->$myselectp)."\""); :local date [/system clock get date] :local time [/system clock get time] :local filec ("cardfile-".[:pick $date 7 11]."-".[:pick $date 0 3]."-".[:pick $date 4 6]."-".[:pick $time 0 2].[:pick $time 3 5].".html") :put "ok fine"; :execute script=$script2write file=$filec; } :global cardmake do={ :for i from=1 to=$cardnumber do={ :local myuser [$gencardname]; /tool user-manager user add username=($myuser->"un") password=($myuser->"pw") customer=$cu ; /tool user-manager user create-and-activate-profile numbers=($myuser->"un") profile=$pr customer=$cu ; :put ("USER : ".($myuser->"un")." **** PASSWORD: ".($myuser->"pw")); :put ("------------------------------------------"); } }