SHOW:
|
|
- or go back to the newest paste.
1 | #hanya untuk ROS yang sudah support fitur "Raw" | |
2 | #tanpa user profile yang lain, hanya ada 2 user profile saja, voucherpagi dan vouchermalam | |
3 | #konter timing berdasarkan inactive time di firewall raw | |
4 | #copy paste di terminal winbox lalu tekan enter : | |
5 | /ip firewall raw | |
6 | add action=passthrough chain=voucherpagi comment="JANGAN DIHAPUS" time=6h-17h59m,sun,mon,tue,wed,thu,fri,sat | |
7 | add action=passthrough chain=vouchermalam comment="JANGAN DIHAPUS" time=18h-5h59m59s,sun,mon,tue,wed,thu,fri,sat | |
8 | ||
9 | #user profile voucherpagi | |
10 | #buatlah user profile dengan nama voucherpagi | |
11 | #isikan dibagian on login script berikut : | |
12 | { | |
13 | :local usernya $user; | |
14 | :if ([/ip hotspot user find name=$usernya limit-uptime=12h]="") do={/ip hotspot user set [find name=$usernya] limit-uptime=12h}; | |
15 | :if ([/system schedule find name=$usernya]="") do={ | |
16 | /system schedule add name=$usernya interval=1d on-event="/ip hotspot user remove [find name=$usernya]\r\n/ip hotspot active remove [find user=$usernya]\r\n/system schedule remove [find name=$usernya]" | |
17 | } | |
18 | :if ([/ip firewall raw get [find chain=voucherpagi] invalid] = true) do={ | |
19 | /ip hotspot active remove [find user=$usernya] | |
20 | /ip hotspot user disable [find name=$usernya] | |
21 | } | |
22 | } | |
23 | ||
24 | ||
25 | #user profile vouchermalam | |
26 | #buatlah user profile dengan nama vouchermalam | |
27 | #isikan dibagian on login script berikut : | |
28 | { | |
29 | :local usernya $user; | |
30 | :if ([/ip hotspot user find name=$usernya limit-uptime=12h]="") do={/ip hotspot user set [find name=$usernya] limit-uptime=12h}; | |
31 | :if ([/system schedule find name=$usernya]="") do={ | |
32 | /system schedule add name=$usernya interval=1d on-event="/ip hotspot user remove [find name=$usernya]\r\n/ip hotspot active remove [find user=$usernya]\r\n/system schedule remove [find name=$usernya]" | |
33 | } | |
34 | :if ([/ip firewall raw get [find chain=vouchermalam] invalid] = true) do={ | |
35 | /ip hotspot active remove [find user=$usernya] | |
36 | /ip hotspot user disable [find name=$usernya] | |
37 | } | |
38 | } | |
39 | ||
40 | #system schedule voucherpagi | |
41 | #buatlah system schedule dengan nama voucherpagi | |
42 | #start time = 17:59:59 | |
43 | #interval 1d | |
44 | #on event script, isikan : | |
45 | /ip hotspot user disable [find profile=voucherpagi] | |
46 | /ip hotspot user enable [find profile=vouchermalam] | |
47 | /ip hotspot active remove [find] | |
48 | ||
49 | ||
50 | #system schedule vouchermalam | |
51 | #buatlah system schedule dengan nama vouchermalam | |
52 | #start time = 05:59:59 | |
53 | #interval 1d | |
54 | #on event script, isikan : | |
55 | /ip hotspot user disable [find profile=vouchermalam] | |
56 | /ip hotspot user enable [find profile=voucherpagi] | |
57 | /ip hotspot active remove [find] |