-
Notifications
You must be signed in to change notification settings - Fork 0
/
Log-in script on hotspot profile.txt
57 lines (29 loc) · 1.46 KB
/
Log-in script on hotspot profile.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Edit in /ip hotspot user profile edit default on-login
:local smtpserv [:resolve "mail.com"];
:local Eaccount "sdg@yyy.com";
:local pass "xxxx";
:local nas [/system identity get name];
:local today [/system clock get date];
:local time1 [/system clock get time ];
:local ipuser [/ip hotspot active get [find user=$user] address];
:local usermac [/ip hotspot active get [find user=$user] mac-address];
:local userphone [/ip hotspot active get [find user=$user] user];
:local userphonelength [:len $userphone];
:set $userphone [:pick $userphone 1 $userphonelength];
:put $userphone;
:put $today;
:put $time1;
:local hour [:pick $time1 0 2];
:local min [:pick $time1 3 5];
:local sec [:pick $time1 6 8];
:set $time1 [:put ({hour} . {min} . {sec})];
:local mac1 [:pick $usermac 0 2];
:local mac2 [:pick $usermac 3 5];
:local mac3 [:pick $usermac 6 8];
:local mac4 [:pick $usermac 9 11];
:local mac5 [:pick $usermac 12 14];
:local mac6 [:pick $usermac 15 17];
:set $usermac [:put ({mac1} . {mac2} . {mac3} . {mac4} . {mac5} . {mac6})];
:put $time1;
/ip firewall address-list add list=$today address="log-in.$time1.$userphone.$usermac.$ipuser";
do {/tool e-mail send from=df@kjhv.com to="jkgdf@jsudhf.com" server=$smtpserv port=587 user=$Eaccount password=$pass start-tls=yes subject="Login number: $user on $nas" body="Login number: $user mac-address: $usermac time: $time1 ip-address: $ipuser"} on-error={};